刚学java,问个很简单的问题,谢谢啦
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()){
....
}