I'm sorry to ask you a question as soon as I signed up.
System.out.println(Inp.nextLine() == "Admin");
In the code above, no matter how I give you the input value, you get the false value, and you get the input value and the string How should I compare to get Boolean as true when I input Admin?
java compare
The equals
method must be used for string (content) comparison.
==
compares the address values.
"Admin".equals(Inp.nextLine())
© 2024 OneMinuteCode. All rights reserved.