I'm new to exceptions and this is what I know so far:
throws
andthrow
are differentdoing
throw IllegalArgumentException
I'll probably have to addthrows IllegalArgumentException
to the method signatureIllegalArgumentException
is an unchecked exception and "Exceptions whose handling is not verified during Compile time"
Sources: http://javarevisited.blogspot.com/2011/12/checked-vs-unchecked-exception-in-java.html#ixzz2yM5jNFeg, http://www.tutorialspoint.com/java/java_exceptions.htm
This is a homework question: does throwing IllegalArgumentException
make the program quit instantly?
The question seems a bit general and likely to be false, but I'm not entirely clear about IllegalArgumentException
either. The sources did not really exemplify throw
in a simple way, so I'm still confused. So, it would be great if there could be a simple explanation to this.