I am trying to apply 2 conditions: read a character at a time and require alpha character input for the same scanner input:
Any suggestions on how to apply these conditions and continue checking each character user inputs?
Scanner lastname = new Scanner(System.in);
System.out.println("Please enter the first letter of last name:");
lastname.useDelimiter("(?<=.)");
if (lastname.hasNext())
System.out.println("character: [" + lastname.next() + "]");
if (!lastname.hasNext("[A-Za-z]+")); {
System.out.println("You are not a robot so do not use numeric characters.");
System.out.println("Please enter letter:");
lastname.next();