这是我的代码:
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String question;
question = in.next();
if (question.equalsIgnoreCase("howdoyoulikeschool?") )
/* it seems strings do not allow for spaces */
System.out.println("CLOSED!!");
else
System.out.println("Que?");
Run Code Online (Sandbox Code Playgroud)
当我试着写"你喜欢学校怎么样?" 答案总是"阙?" 但它的工作正常,因为"howdoyoulikeschool?"
我应该将输入定义为除String之外的其他内容吗?