I'm trying to see if the user typed in a string or not, If they did not I want the program to keep asking for the user's name.
public static void main(String[] args) {
// TODO code application logic here
Scanner myObj = new Scanner(System.in); // Create a Scanner object
System.out.println("Hello Shopper, what is your name?");
String Name = myObj.nextLine(); // Read user input
System.out.println("Thank you, " + Name + " It is my pleasure to shop with you today.");
System.out.println("Press enter to exit");
String exit = myObj.nextLine();
System.exit(0);// Output user input
}
}