当我在控制台中输入一个短语时,绿色文本下方只出现一个单词,而其他单词没有出现。不知道我在这里做错了什么。任何帮助,将不胜感激。
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter a sentence or phrase. It can be anything you want it to be: ");
//ask user for sentence or phrase
String p1 = keyboard.next();
System.out.println(c1); //display user sentence or phrase