Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boolean good=true;
- System.out.println("What is the Item Number?");
- while (!good)
- {
- try
- {
- good = true;
- itemNumber= Integer.parseInt(input.nextLine());
- }
- catch(NumberFormatException ex)
- {
- good = false;
- System.out.println(ex.getMessage()+" -The following value must be an integer-");
- }
- }
Add Comment
Please, Sign In to add comment