我想知道如何输入名字;用户将输入他的名字和姓氏一次输入
Scanner addressInput = new Scanner(System.in);
System.out.println("Enter your name:");
String name = addressInput.next();
我想要这样的输入格式: 名称(空格)第二名
最佳答案
使用addressInput.nextLine()
代替.next()
关于java - 如何在java中输入两个名字之间有空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58125637/