 <p>First of all,you're never reading your input in a variable!and then you're trying to check equality between the "scan" object which is of type Scanner.Instead read input "scan.nextLine();" in a variable say "var" and then call var.equals(password).Please also check that your String "Fish" is null initially which will give you a NullPointerException!</p>