throw
Keyword
throw
statement allows you to create a custom error.
The throw
statement is used together with an exception type.
There are many exception types available in Java, for example,
ArithmeticException
, which is thrown when an exceptional arithmetic condition has occurred
ClassNotFoundException
, which is thrown when an application tries to load a class, but no definition for the class with the specified name could be found
ArrayIndexOutOfBoundsException
, which is thrown to indicate that an array has been accessed with an illegal index
SecurityException
, which is thrown by the security manager to indicate a security violation
I was banging my head against the wall (feeling angry or annoyed) trying to lose weight without exercising. |