I would like to check user input value against a declared final variable to make sure it does not exceed the final int variable for the purpose of using in a try-catch-finally.
final int variable = 20; // Variable declared for max allowable
int userInput = 0; // Used to hold user input from GUI interface
try {
userInput > variable; // This does not work
}
catch (ArithmeticException e) {
System.out.println("Your input exceeds max allowble.");
}
finally {
System.out.println("Good, input does not exceed max allowable.");
}
}