Name: Anonymous 2007-01-18 21:52
None of these end up as true when I enter "yes", "y", or "Y". I've tried entering them with and without quotes. What am I doing wrong?
System.out.println("yes/no");
//get answer
getDirections = in.nextLine();
if (getDirections == "yes"){
game.printDirections();
}
if (getDirections == "y"){
game.printDirections();
}
if (getDirections == "Y"){
game.printDirections();
}
System.out.println("yes/no");
//get answer
getDirections = in.nextLine();
if (getDirections == "yes"){
game.printDirections();
}
if (getDirections == "y"){
game.printDirections();
}
if (getDirections == "Y"){
game.printDirections();
}