I have an InputMismatchException which stops a decimal from being entered, but it doesn't help for negative integers/negative decimals.
if(userInput == 1) {
int l;
l = 0;
try {
l = input.nextInt();
} catch (InputMismatchException e) {
System.out.println("");
input.next();
}
}
If I add a do while loop with an if statement for anything equal to or less than zero it will loop within the if(userInput == 1) statement instead of starting from the beginning of the menu like it does if a positive decimal is entered. It also doesn't help for negative decimals.
I've tried to add two exceptions to the catch, but can't get that to work.