Why does this Java if statement not work?

Viewed 41
    //try again block
    
    System.out.println("Try again?");
    
    String again = myObj.nextLine();
    
    if (again == "yes")
    {
    Menu();
    }
    //why does this not work?
    
    //it seems to absorb the proper value so I'm at a loss
    System.out.println(again);

I don't know that there's much else to say. Menu() will fire if its encased in an if statement.

0 Answers
Related