<span>The character to the right of the cursor is deleted. </span>
Unless you share the backup HD only the local user is going to see it. Given that it's a server, it's not a problem. You can also hide the backup with attributes +h +s and many other ways.
We can import Scanner from Java.utils.Scanner to pull in text entered in the console.
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String password = "";
do {
System.out.print("Enter your password: ");
password = sc.nextLine();
if(!password.equals("pals") {
System.out.println(\nIncorrect Password. Try again.");
}
} while(!password.equals("pals");