InputTest.java

InputTest.java
/**
*读取键盘输入
*/
import javax.swing.JOptionPane;
public class InputTest{
public static void main(String[] args){
String strName=JOptionPane.showInputDialog("Input your name:");
String strAge=JOptionPane.showInputDialog("Input your age:");
int age=Integer.parseInt(strAge);
System.out.println("Welcome you :"+strName);
System.out.println("你还有"+(60-age)+"年可以退休了!!");
System.exit(0);
}
}

你可能感兴趣的:(InputTest.java)