So I am currently learning java and its my first time to encounter this problem. I don't know how to fix this error. It says that passwordInput cannot be resolved to a variable
and I dont know what does that mean.
This is my whole code:
import java.util.Scanner;
public class Password {
public static void main(String[] args) {
String username = "JohnPaul";
int password = 11062223;
System.out.println("PLEASE INSERT YOUR CARD TO LOGIN");
System.out.println("Username : ");
Scanner scan = new Scanner (System.in);
String usernameInput = scan.nextLine();
if(usernameInput.equals(username)) {
System.out.println("Password : ");
int passwordInput = scan.nextInt();
scan.nextLine();
System.out.println(passwordInput);
}
else
System.out.println("User not found.");
System.out.println(passwordInput);
}
}