So I'm teaching myself Java. I'm creating a text based game. I have an if statement that i want to check users input so its like this:
if(sc.next() = "help"){
System.out.println("info");
} else if(sc.next() = "item"){
System.out.println("info");
}
Etc. But it wont work. What would be the proper way to do this? Do i need to capture the users input into a variable first then compare?