for the last few hours i've been trying to get this code to only allow character input, as its for accepting names.. I have been following the same type of method i used to allow only integers, but with no luck. any advice would be great, Here is my code
String name;
System.out.println("Enter student's name: ");
name = in.nextLine();
while (!in.nextLine().matches("[a-zA-Z]"));
{
System.out.println("Please enter a valid name!: ");
in.next();
}
name = in.nextLine();