[问答题] 程序如下: ∥计算两个整数的乘法 Java_1. java import javax, swing. JOptionPane; public class Java_1{
18 查阅
[问答题]
程序如下:
∥计算两个整数的乘法 Java_1. java
import javax, swing. JOptionPane;
public class Java_1{
public static void main(String args[ ]){
int x, y, result;
String xVal, yVal;
xVal = JOptionPane. showInputDialog("输入第1个整数:");
yVal = JOptionPane. showInputDialog("输入第2个整数:");
∥********** Found **********
x = Integer. parseInt( (1) );
y = Integer. parseInt(yVal);
result = x * y;
∥********** Found **********
JOptionPane. (2) ( null,"两个数的积:"+result);
System. exit(0);
}
}
参考答案: