java while loop

java while loop

#java #while #loop

import java.util.scanner;

public class main {

public static void main(string[] args) {

// while loop = executes a block of code as long as a it's condition remains true

scanner scanner = new scanner(system.in);
string name = "";

while(name.isblank()) {
system.out.print("enter your name: ");
name = scanner.nextline();
}

system.out.println("hello "+name);

}
}

java while loop