In most code that you’ll write it will be necessary to check the input.
In Java use Exception Handling to make sure that your program not crashes. Instead will the program throw a message to the user of the program that something is wrong with the input.