I want the code to be if entered "shoot" then it'll print "Nice, you killed the zombie" and if the user inputs "don't shoot" then it'll print "oh no, the zombie killed you"
this is what I've done so far but it won't print out anything.
public static void main(String[] args) {
System.out.println("ZOMBIE AHEAD!");
Scanner kb = new Scanner(System.in);
String action1 = "shoot";
String action2 = "don't shoot";
String str = kb.nextLine();
if (str == action1) {
System.out.println("Nice, you killed the zombie!");
} else if (str == action2) {
System.out.println("Oh no, the zombie killed you!");
}
}
}