关于nextLine的问题
System.out.println("Please describe the food you have:");
String s2=mysc.nextLine();
System.out.println("What is the volume of the food you have (in millilitres)?");
结果:
Please describe the food you have:
What is the volume of the food you have (in millilitres)?
问题:他直接两条输出语句都给我输出了。
我的目的是请输出第一行,然后输入食物的描述(中间会用到空格),然后再输出第三行。
不使用IO能解决这个问题吗?