I'm trying to make it so it shows an error message if a user uses more or less than 4 digits.
Code snippet
int pin = scan.nextInt(); // Read user input
if (pin > 4 && pin < 4) {
System.out.println("Invalid Usage, please try again ");
}
if (pin == 9681){
System.out.println("Correct Pin");
} else {
System.out.println("Incorrect Pin, please try again.");
I know that it's not counting the digits but I have no idea what other function I should use.