posted 17 years ago
Two examples of Exception objects that can be thrown by the JVM are: 1) the NullPointerException if you try to dereference an object reference variable that is null, and 2) an exception can be thrown by the JVM if you do a division operation on whole numbers and divide by zero.
You can throw your own exceptions with the keyword "throw".
Exceptions can also be thrown using the "assert" keyword if the boolean value that you are asserting is false and assertions are enabled.