有关java 请高手指教为什么无法运行
importjavax.swing.JOptionPane;publicclassyunsuan{publicstaticvoidmain(Stringargs[]){S...
import javax.swing.JOptionPane;
public class yunsuan{
public static void main(String args[])
{
String firstNumber;
String secondNumber;
int number1;
int number2;
int sum;
int difference;
int product;
int quotient;
firstNumber=JOptionPane.showInputDialog("Enter first integer");
secondNumber=JOptionPane.showInputDialog("Enter second integer");
number1=Integer.parseInt(firstNumber);
number2=Integer.parseInt(secondNumber);
sum=number1+number2;
difference=number1-number2;
product=number1*number2;
quotient=number1/number2;
JOptionPane.showMessageDialog(null, "The sum is "+ sum ,"The difference is "+difference, "The
product is "+product,"The quotient is "+quotient,"Results",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
} 展开
public class yunsuan{
public static void main(String args[])
{
String firstNumber;
String secondNumber;
int number1;
int number2;
int sum;
int difference;
int product;
int quotient;
firstNumber=JOptionPane.showInputDialog("Enter first integer");
secondNumber=JOptionPane.showInputDialog("Enter second integer");
number1=Integer.parseInt(firstNumber);
number2=Integer.parseInt(secondNumber);
sum=number1+number2;
difference=number1-number2;
product=number1*number2;
quotient=number1/number2;
JOptionPane.showMessageDialog(null, "The sum is "+ sum ,"The difference is "+difference, "The
product is "+product,"The quotient is "+quotient,"Results",JOptionPane.PLAIN_MESSAGE);
System.exit(0);
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询