Scanner class not waiting for customer input and throws an exception
I’m struggling with this code piece when using Scanner class. When introducing option 1 or 2, everything goes smooth, the program executes them and shows back the initial menu to introduce by the keyboard a new option. The problem comes with the option 3, because it executes it perfectly but when when showing the initial menu with the options, the Scanner doesn’t wait for any keyboard input from the user and throws the following exception:
Scanner class not waiting for customer input and throws an exception
I’m struggling with this code piece when using Scanner class. When introducing option 1 or 2, everything goes smooth, the program executes them and shows back the initial menu to introduce by the keyboard a new option. The problem comes with the option 3, because it executes it perfectly but when when showing the initial menu with the options, the Scanner doesn’t wait for any keyboard input from the user and throws the following exception: