日期:2014-05-20 浏览次数:20700 次
public class g
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter your name: ");
String name = keyboard.nextLine();
System.out.println("Enter your age: ");
int age = keyboard.nextInt();
System.out.println("Enter your nickname: ");
String nickName = keyboard.nextLine();
System.out.println(name);
System.out.println(age);
System.out.println(nickName);
}
}
while(keyboard.nextLine()){
....
}