请 各位大哥帮帮~ 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);
}
}
可是错误报告中的解释
请高手帮我下 谢谢