请 各位大哥帮帮~ import javax.swing.JOptionPane 求闰年
//InputDialogDemo.java:Entering input from input dialog boxesimport javax.swing.JOptionPane;
public class InputDialogDemo
{
//*Main method*/
public staitc void main(String args[])
{
//Prompt the user to enter a year
String yearString = JOptionPane.showInputDialog(null,
"Enter a year","Example 2.2 Input(int)",
JOptionPane.QUESTION_MESSAGE);
//Convert the string into an int value
int year = Integer.parseInt(yearString);
//Check if the year is leap year
boolen isLeapYear =
((year%4==0)&&(year%100!=0))||(year%400==0);
//Display the result in a message dialog box
JOptionPane.showMessageDialog(null,
year + "is a leap year?" + isleapyear,
"Example 2.2 Output (int)",JOptinPane.INFORMATION_MESSAGE);
//Prompt the user to enter a double value
String doubleString = JOptionPane.showInputDialog(null,
"Enter a double value", "Example 2.2 Input (double)",
JoptionPane.QUESTION_MESSAGE);
//Convert the string into a double value
double doubleValue = Double.parseDouble(doubleString);
//Cheak if the number is positive
JOptionPane.showMessageDialog(null,
doubleValue + "is positive?" +(doubleValue>0),
"Example 2.2 Output (double)",
JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
}
可是错误报告中的解释
请高手帮我下 谢谢
----------------解决方案--------------------------------------------------------
伙计.么把注释搞英文啊.看不懂英语啊
----------------解决方案--------------------------------------------------------
public staitc void main(String args[])
应该是static
----------------解决方案--------------------------------------------------------
回复:(dingningvol)请 各位大哥帮帮~ import javax...
多谢 我肯定是眼花了 这么明显~~ ----------------解决方案--------------------------------------------------------
这么强啊,注译都弄成英文!
----------------解决方案--------------------------------------------------------
你那个命令提示符里报错不是都写着报错的位置吗?
----------------解决方案--------------------------------------------------------