<<< The finally Block | Index | Code that prevents an InputMismatchException >>> |
There are methods of the Scanner class that you can use to validate data:
hasNext( )
hasNextInt( )
hasNextDouble( )
nextLine( )
<<< The finally Block | Index | Code that prevents an InputMismatchException >>> |