` public Player CreateYourCharacter(){
System.out.println("What is your name?");
String playerName = scanner.nextLine();
while (NameInputCheck(playerName) == false){
System.out.println("Please input a name.");
playerName = scanner.nextLine();
NameInputCheck(playerName);
}
return new Player(playerName);
}
public Boolean NameInputCheck(String nameInput){
return !nameInput.isEmpty();
}`
I want it in a loop to make sure the name isn't an empty string. I just had the thought of using try and catch for this, but I can't think of it being logical/useful for my case, as I want this to be in a loop until I get the right input. Is my judgement correct?