CAN SOMEONE TELL ME HOW THE console eraser work in the below PROGRAM PART...............describe the LOGIC???????????
//Creating and hiding password.
ConsoleEraser consoleEraser = new ConsoleEraser();
System.out.println();
System.out.println("(Please enter the common Password)");
System.out.print("PASSWORD : ");
BufferedReader passin = new BufferedReader(new
InputStreamReader(System.in));
consoleEraser.start();
String passWord = passin.readLine();
consoleEraser.halt();
System.out.print("\b");
//Password matching.
if("libStaff".equals(passWord)) {
//password testing by printing System.out.println("Password: '" + passWord + "'" );
a1.Interface ();
m1.mainMenu ();
}
else {
System.out.println();
System.out.println("You have entered a invalid password!!!");
System.out.println("Please enter a correct password...");
p1.Pass ();
}
}
}
class ConsoleEraser extends Thread {
private boolean running = true;
public void run(){
while (running) {
System.out.print("\b ");
}
}
public synchronized void halt() {
running = false;
}
}