JOPtionPane.showInputDialog()的各个参数详解,为什么我的这个小程序不对?
程序代码:
import javax.swing.*; public class Class3 { public static void main(String[] args) { int num1=(int)(System.currentTimeMillis()%10); int num2=(int)(System.currentTimeMillis()*7%10); int num3=(int)(System.currentTimeMillis()*3%10); String answer = JOPtionPane.showInputDialog("what is "+num1+"+"+num2+"+"num3+"?"); int answerInt =Integer.parseInt(answer); JOPtionPane.showMessageDialog(null,num1+"+"+num2+"+"+num3+"="+answerInt+"is" (num1+num2+num3==answerInt)); } }