Contents Prev Next Up


3.16 Exception Handling

athrow

Throw exception
 
athrow = 191
or error

Stack: ..., objectref => [undefined]

objectref must be a reference to an object which is a subclass of Throwable, which is thrown. The current Java stack frame is searched for the most recent catch clause that catches this class or a superclass of this class. If a matching catch list entry is found, the pc is reset to the address indicated by the catch-list entry, and execution continues there.

If no appropriate catch clause is found in the current stack frame, that frame is popped and the object is rethrown. If one is found, it contains the location of the code for this exception. The pc is reset to that location and execution continues. If no appropriate catch is found in the current stack frame, that frame is popped and the objectref is rethrown.

If objectref is null, then a NullPointerException is thrown instead.


Contents Prev Next Up