I am having a problem with my while loop. It is compiling but it isn't entering while loop and it skips to next condition.
public class Tr {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String name = "";
while(name.length() > 1) {
System.out.print("Enter name : ");
name = in.nextLine( );
if(name.length() > 1) {
System.out.println("It needs to be greater than 1");
}
}
}
}