If this is a console window application, you can use one of the next... methods of the Scanner class to read input from a user.

Then use an if statement to test if the input is correct.