Why isn't the message in the function get printed?, i tried other command from the Exception class
but i never get anything out. i always have to put a
System.out in there to see what happen. and even worse if i have more than one functions then i don't even know who threw it.

The way around this that i use is creating my exception class extending whatever i wanted to catch
and from there it would always print.
ex :

class CatchErrorException () extends Illegal...
{}

if i caught this in main, and foo was throwing this instead then it would display the "Value is Invalid " from the food method. is this the only way? i'm getting tired
of making classes that basically do the same thing just so i can have the Error output and know where it came from. In longer programs it's almost impossible to know where the Exception came from unless your write extension of all the exceptions you want to catch and no way i'm doing that :o .

If anyone still reading this far and know why java does this, please let me know, no rush on this.