I am fairly new to java(as in started 2 days ago) and i would like to know how i could loop this program. I tried to do the do while function but it keeps saying that my variables cannot be resolved as a variable.
This is the code:
class GS1 {
public static void main(String[]args){
do {
System.out.println("Enter your password");
Scanner F_pass = new Scanner(System.in);
String f_word= F_pass.next();
System.out.println("Verify Password");
Scanner Pass = new Scanner(System.in);
String word = Pass.next();
} while(f_word != word);
}
}