package com.company;
import java.lang.String;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        String str = "";
        do{
            Scanner input = new Scanner(System.in);
            System.out.print("Input: ");
            str = input.nextLine();
        }while(str != "key123");
        System.out.print("Good!");
    }
}
The user must enter the correct key, but the code doesn't work and I can't figure out why?
Screen shot:
 
    