10/17 輸入數字到視窗
import javax.swing.JOptionPane;
public class q1
{
public static void main(String[] args)
{
String myString=JOptionPane.showInputDialog("Enter a number: ");
int myNumber = Integer.parseInt(myString);
System.out.println("The number is "+ myNumber);
}
}
public class q1
{
public static void main(String[] args)
{
String myString=JOptionPane.showInputDialog("Enter a number: ");
int myNumber = Integer.parseInt(myString);
System.out.println("The number is "+ myNumber);
}
}
0 Comments:
張貼留言
<< Home