In my online Java programming class I have to write a program where the user enters their age, and checks if it\'s between 0 and 125 - if it isn\'t, it shows an error code,
java -ea <program_name> should do it on the command prompt.
java -ea <program_name>
You can try the following for intellJ and eclipse respectively.