import java.util.Scanner;
public class Mal {
public static void main(String[] args) {
System.out.println("Welcome");
Scanner myinput = new Scanner(System. in);
System.out.println("Make your choise. \n 1.Check a card number \n 2.Quit.");
int choise = myinput.nextInt();
switch (choise) {
case 1:
System.out.println("Enter your credit card number: ");
break;
case 2:
System.out.println("Are you sure?");
String answer = myinput.next();
if (answer == "yes") {
System.out.println("Byee ");
} else {
break;
}
default:
System.out.println("Idiot!");
break;
}
}
我怎樣才能得到鍵盤的字符串答案?在Java程序中幫助
什麼是鍵盤?這個計劃的目的是什麼? – 2011-03-31 02:02:30
我猜[[Clavier]](http://en.wikipedia.org/wiki/Clavier)的意思是「鍵盤」。 – 2011-03-31 02:07:24
你的意思是它不是魚蛋? – 2011-03-31 02:11:47