Answer the question
In order to leave comments, you need to log in
Why doesn't Java understand the condition?
System.out.println("Все верно?(y/n)");
Scanner answ = new Scanner(System.in);
if (answ.nextLine() == "y")
System.out.println("Ok");
if (answ.nextLine() == "n")
System.out.println("Try again");
else
System.out.println("Неверный ввод(y/n)");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question