SDSU CS535 Object-Oriented Programming & Design
Fall Semester, 1996
Doc 12, Exceptions

[To Lecture Notes Index]
San Diego State University -- This page last updated Oct 7, 1996
----------

Contents of Doc 12, Exceptions

  1. References
  2. Exceptions
    1. Issues
    2. How is the exception raised?
    3. Where can the Handler be placed?
    4. How is the handler for the exception found?
      1. Finding the handler for Unchecked exception
      2. Finding the handler for Checked exceptions
    5. Multiple Exceptions
    6. What is executed after the handler has finished?
    7. Final Block - For Clean Up
    8. What information is passed to the handler?
    9. User Defined Exceptions
    10. Tips on Using Exceptions
    11. List of All Built-in Exceptions

Doc 12, Exceptions Slide # 1

References


Core Java, Chapter 10

The Java Programming Language, Arnold and Gosling, Chapter 7



A slipped gear could let your M203 grenade launcher fire when you least expect it. That would make you quite unpopular in what's left of your unit.
The U.S. Army's PS magazine, August 1993


Doc 12, Exceptions Slide # 2Listen Here!

Exceptions

Out-of Bounds

Java checks the bounds of arrays

class  ArrayOutOfBounds 
   {

   public static void main( String args[] ) 
      {
      int  students[] = new int[5];

      students[  10  ]  =  1;
      System.out.println( " The End" );
      }
   }
Output

java.lang.ArrayIndexOutOfBoundsException: 10
at ArrayOutofBounds.main(All.java:8)

Doc 12, Exceptions Slide # 3Listen Here!
Exception Handling

In a program there are events which may be considered exceptional or unusual
Error conditions
On zero divide have the program do some recovery process or give some debugging information
Special conditions
If a plane is about to collide midair the navigation program should perform some special operation


Exceptional cases can be handled by explicit tests
   Boolean computeFoobar( ) {
      Boolean  zeroDivideFlag = false;

      if  ( A * A - 2 * B = 0 )
         zeroDivideFlag = true;
      else 
         result = sqrt( C )/ ( A * A - 2 * B )
      return zeroDivideFlag 
   }

   // in main

   flag  =  computeFoobar( )
   if ( flag == true )
      // now what?

Doc 12, Exceptions Slide # 4Listen Here!
Definitions
Exception
A condition that is detected by an operation, that cannot be resolved within the local context of the operation, and must be brought to the attention of the operation's invoker
Exception handler or handler
The procedure or code that deals with the exception
Raising the exception
The process of noticing the exception, interrupting the program and calling the exception handler
Propagating the exception
Reporting the problem to a higher authority (the calling program)
Handling the exception
Taking appropriate corrective actions
Languages with Exception Handling

PL1, Clu, ADA, Mesa, C++, Smalltalk, Java

Doc 12, Exceptions Slide # 5Listen Here!

Issues


How is the exception raised?



Where can the Handler be placed - Scope of handler



How is the handler for the exception found?
All languages find the handler dynamically


What is executed after the handler has finished?



What information is passed to the handler?

Doc 12, Exceptions Slide # 6Listen Here!

How is the exception raised?

Implicitly by some error condition

class  ImplicitlyRaisedException
   {
   public static void main( String[] arguments )
      {
      int  students[] = new int[5];
      students[  10  ]  =  1;         // Exception occurs here
      }
   }

Explicitly by the Programmer
class  ExplicitlyRaisedException
   {
   public static void main( String[] arguments )
      {
      throw  new  ArrayIndexOutOfBoundsException()
      }
   }




Doc 12, Exceptions Slide # 7Listen Here!

Where can the Handler be placed?

Out-of Bounds - With try

class  ArrayOutOfBounds 
   {

   public static void main( String args[] ) 
      {
      int  students[] = new int[5];

      try  
         {
         System.out.println(  "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After assignment statement"  );
         }

      //  catch is the handler
      catch (ArrayIndexOutOfBoundsException e) 
         {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
         };

      System.out.println(  " After try " );
      }
   }

Output

Start Try
OutOfBounds: 10
After try

Doc 12, Exceptions Slide # 8Listen Here!
try and catch must be together

try and catch are not separate blocks
try and catch are one construct

class  NeedCatchWithTryBlock 
   {

   public static void main( String args[] ) 
      {
      int  students[] = new int[5];

      try  
         {
         System.out.println(  "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After assignment statement"  );
         }

      System.out.println(  " After try " );      // Compile error
      }
   }

Compile Error


All.java:15: 'try' without 'catch' or 'finally'.
System.out.println( " After try " );

Doc 12, Exceptions Slide # 9
try and catch must be together

try and catch are not separate blocks
try and catch are one construct

class  NeedTryWithCatch 
   {

   public static void main( String args[] ) 
      {
      int  students[] = new int[5];

      System.out.println(  "Start Try"  );
      students[  10  ]  =  1;
      System.out.println(  "After assignment statement"  );

      //  catch is the handler
      catch (ArrayIndexOutOfBoundsException e) 
         {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
         };

      System.out.println(  " After try " );
      }
   }

Compile Error

'catch' without 'try'.
catch (ArrayIndexOutOfBoundsException e)

Doc 12, Exceptions Slide # 10
try and catch must be together

try and catch are not separate blocks
try and catch are one construct

class  CanNotHaveCodeBetweenTryAndCatch 
   {
   public static void main( String args[] ) 
      {
      int  students[] = new int[5];

      try  
         {
         System.out.println(  "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After assignment statement"  );
         }

      int  DontHaveCodeHere  =  5 / 32;      // Error here

      //  catch is the handler
      catch (ArrayIndexOutOfBoundsException e) 
         {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
         };

      System.out.println(  " After try " );
      }
   }
Compile Error

'try' without 'catch' or 'finally'.
int DontHaveCodeHere = 5 / 32;
'catch' without 'try'.
                catch (ArrayIndexOutOfBoundsException e)

Doc 12, Exceptions Slide # 11Listen Here!

How is the handler for the exception found?


The rules are slightly different for the two types of exceptions: Checked and Unchecked


Checked
Methods are required to state if they throw these exceptions

Unchecked
Standard runtime exceptions and errors
Methods are not required to state if they throw these exceptions
Subclasses of RuntimeException and Error are unchecked
AWTErrorArithmeticException
LinkageErrorArrayStoreException
ClassCircularityErrorClassCastException
ClassFormatErrorEmptyStackException
IncompatibleClassChangeErrorIllegalArgumentException
AbstractMethodErrorIllegalThreadStateException
IllegalAccessErrorNumberFormatException
InstantiationErrorIllegalMonitorStateException
NoSuchFieldErrorIndexOutOfBoundsException
NoSuchMethodErrorArrayIndexOutOfBoundsException
NoClassDefFoundErrorStringIndexOutOfBoundsException
UnsatisfiedLinkErrorNegativeArraySizeException
VerifyErrorNoSuchElementException
ThreadDeathNullPointerException
VirtualMachineErrorSecurityException
InternalErrorStackOverflowError
OutOfMemoryErrorUnknownError

Doc 12, Exceptions Slide # 12Listen Here!

Finding the handler for Unchecked exception


Unchecked Exceptions: Search the stack for the first enclosing try block
class  FindHandlerSimpleExample  
{
   public  static  void  change(  int[]  course  )  
   {
      System.out.println( "Start Change"  );
      course[ 10 ]  =  1;
      System.out.println( "End Change"  );
   };

   public  static  void  main( String args[] ) 
   {
      int  students[] = new int[5];
      try  
      {
         System.out.println( "Start Try"  );
         change( students );
         System.out.println(  "After change"  );
      }  
      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
      }   
      System.out.println(  "After try "  );
   }
}
Output
Start Try
Start Change
OutOfBounds: 10
After try

Doc 12, Exceptions Slide # 13Listen Here!
Finding handler for Unchecked Exceptions
class  FindHandlerDoubleExample  {
   public  static  void  doubleChange(  int[]  course  )  {
      System.out.println( "Start Double Change"  );
      course[ 10 ]  =  1;
      System.out.println( "End Double Change"  );
   };

   public  static  void  change(  int[]  course  )  {
      System.out.println( "Start Change"  );
      doubleChange( course );
      System.out.println( "End Change"  );
   };

   public  static  void  main( String args[] ) {
      int  students[] = new int[5];
      try  
      {
         System.out.println( "Start Try"  );
         change( students );
         System.out.println(  "After change"  );
      }  
      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
      }   
      System.out.println(  "After try "  );
   }
}
Output
Start Try
Start Change
Start Double Change
OutOfBounds: 10
After try

Doc 12, Exceptions Slide # 14Listen Here!
Finding handler for Unchecked Exceptions
class  FindHandlerTwoTryBlocks  {
   public  static  void  change(  int[]  course  )  {
      try
      {
         System.out.println( "Start Change"  );
         course[ 10 ]  =  1;
         System.out.println( "End Change"  );
      }
      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "Change Catch: "  +  e.getMessage());
      }
   };

   public  static  void  main( String args[] )  {
      int  students[] = new int[5];
      try  
      {
         System.out.println( "Start Try"  );
         change( students );
         System.out.println(  "After change"  );
      }
      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "Main Catch: "  +  e.getMessage());
      }
      System.out.println(  "After try "  );
   }
}
Output
Start Try
Start Change
Change Catch: 10
After change
After try

Doc 12, Exceptions Slide # 15
Finding handler for Unchecked Exceptions

What happens if there is no try block?
class  NoHandler  
{
   public  static  void  change(  int[]  course  )  
   {
      System.out.println( "Start Change"  );
      course[ 10 ]  =  1;
      System.out.println( "End Change"  );
   };

   public  static  void  main( String args[] ) 
   {
      int  students[] = new int[5];
      System.out.println( "Start Try"  );
      change( students );
      System.out.println(  "After change"  );
   }
}
Output

Start Try
Start Change
java.lang.ArrayIndexOutOfBoundsException: 10
at test.main(classNotes.java)

Doc 12, Exceptions Slide # 16Listen Here!

Finding the handler for Checked exceptions


Check Exceptions must be either:
handled in the method they are thrown or
the method in which they are thrown must state they will throw the exception
import sdsu.io.ASCIIInputStream;
import java.io.*;

class  CheckedExceptionDeclaredInMethod  {
   public  static  void  readSomething() throws IOException
   {
      System.out.println( "Please type an integer: " );
      int  youTyped;
      ASCIIInputStream  input = new ASCIIInputStream(System.in);

      youTyped = input.readInt();   // throws IOException
   };

   public  static  void  main( String args[] ) {
      try  
      {
         System.out.println( "Start Try"  );
         readSomething();
         System.out.println(  "After readSomething"  );
      }  
      catch  (IOException e) 
      {
         System.err.println( "IO error: "  +  e.getMessage());
      }   
      System.out.println(  "After try "  );
   }
}

Doc 12, Exceptions Slide # 17
Finding the handler for Checked exceptions
class  CheckedExceptionHandledInMethod  
{
   public  static  void  readSomething()
   {
      try
      {
         System.out.println( "Please type an integer: " );
         int  youTyped;
         ASCIIInputStream  input;
         input = new ASCIIInputStream(System.in);

         youTyped = input.readInt();   // throws IOException
      }
      catch  (IOException e) 
      {
         System.err.println( "IO error: "  +  e.getMessage());
      }   
   };

   public  static  void  main( String args[] ) 
{
      System.out.println( "Start Try"  );
      readSomething();
      System.out.println(  "After readSomething"  );
   }
}

Doc 12, Exceptions Slide # 18
Finding the handler for Checked exceptions
class  IfYouDontDeclaredInMethod  
{
   public  static  void  readSomething() 
   {
      System.out.println( "Please type an integer: " );
      int  youTyped;
      ASCIIInputStream  input = new ASCIIInputStream(System.in);

      youTyped = input.readInt();   // throws IOException
   };

   public  static  void  main( String args[] ) {
      try  
      {
         System.out.println( "Start Try"  );
         readSomething();
         System.out.println(  "After readSomething"  );
      }  
      catch  (IOException e) 
      {
         System.err.println( "IO error: "  +  e.getMessage());
      }   
      System.out.println(  "After try "  );
   }
}
Compile Error
Error   : Exception java.io.IOException must be caught, or it must be declared in the throws clause of this method.
line 12         youTyped = input.readInt();

Error   : Exception java.io.IOException is never thrown in the body of the corresponding try statement.
line 22         catch  (IOException e) 



Doc 12, Exceptions Slide # 19Listen Here!
Finding the handler for Checked exceptions
class  SometimesItMakesSenseToDoBoth  
{
   public  static  void  readSomething() throws
   {
      try
      {
         System.out.println( "Please type an integer: " );
         int  youTyped;
         ASCIIInputStream  input;
         input = new ASCIIInputStream(System.in);

         youTyped = input.readInt();   // throws IOException
      }
      catch  (IOException e) 
      {
         System.err.println( "IO error: "  +  e.getMessage());
         throw e;
      }   
   };

   public  static  void  main( String args[] ) {
      try  
      {
         readSomething();
      }  
      catch  (IOException e) 
      {
         System.err.println( "Error: "  +  e.getMessage());
      }   
      System.out.println(  "After try "  );
   }
}

Doc 12, Exceptions Slide # 20Listen Here!

Multiple Exceptions


class  MultipleExceptions  
   {

   public static void main( String args[] ) 
      {
      int  students[] = new int[5];
      int  classSize  =  0;

      try  
         {
         System.out.println( "Start Try"  );
         int  classAverage  =  10 / classSize;
         System.out.println( "After class average"  );
         students[  10  ]  =  1;
         System.out.println(  "After array statement"  );
         } 

      catch  (ArrayIndexOutOfBoundsException e) 
         {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
         }

      catch  (  ArithmeticException  e  )  
         {
         System.err.println( " Math Error"  +  e.getMessage() );
         }
      System.out.println(  " After try " );
      }
   }
Output
Start Try
Math Error/ by zero
After try

Doc 12, Exceptions Slide # 21Listen Here!
One Size Fits All Exception

class  MultipleExceptions  
   {
   public static void main( String args[] ) 
      {
      int  students[] = new int[5];
      int  classSize  =  0;

      try  
         {
         System.out.println( "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After array statement"  );
         
         int  classAverage  =  10 / classSize;
         } 

      catch  ( Exception  e )    // Not a good idea
         {
         System.err.println( "Exception:"  +  e.getMessage());
         e.printStackTrace();
         }
 
      System.out.println(  " After try " );
      }
   }
Output

Start Try
Exception:10
java.lang.ArrayIndexOutOfBoundsException: 10
at MultipleExceptions.main(All.java:11)
After try
Doc 12, Exceptions Slide # 22Listen Here!
Beware of Order
class  MultipleExceptions  
{
   public static void main( String args[] ) 
      {
      int  students[] = new int[5];
      int  classSize  =  0;

      try  
      {
         System.out.println( "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After array statement"  );
         
         int  classAverage  =  10 / classSize;
      }  
      catch  ( Exception  e ) 
      {
         System.err.println( "Exception:"  +  e.getMessage());
         e.printStackTrace();
      }  
      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
      }
      System.out.println(  " After try " );
   }
}
Compile Error
All.java:21: catch not reached.
} catch (ArrayIndexOutOfBoundsException e) {
^
1 error

Doc 12, Exceptions Slide # 23Listen Here!
Select the First Exception That Applies
class  MultipleExceptions  
{
   public static void main( String args[] ) 
      {
      int  students[] = new int[5];
      int  classSize  =  0;

      try  
      {
         System.out.println( "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After array statement"  );
         
         int  classAverage  =  10 / classSize;
      }  

      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "OutOfBounds: "  +  
                                 e.getMessage());
      }   

      catch  ( Exception  e ) 
      {
         System.err.println( "Exception:"  +  e.getMessage());
         e.printStackTrace();
      }
      System.out.println(  " After try " );
   }
}
Output
Start Try
OutOfBounds: 10
After try

Doc 12, Exceptions Slide # 24Listen Here!

What is executed after the handler has finished?


The line of code after the try block

Finally blocks change this slightly
class  ArrayOutOfBounds 
   {

   public static void main( String args[] ) 
      {
      int  students[] = new int[5];

      try  
         {
         System.out.println(  "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After assignment statement"  );
         }

      //  catch is the handler
      catch (ArrayIndexOutOfBoundsException e) 
         {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
         };

      System.out.println(  " After try " );
      }
   }
Output

Start Try
OutOfBounds: 10
After try

Doc 12, Exceptions Slide # 25Listen Here!
Exceptions inside Exceptions
class  ExceptionFunction  {
   public  static  boolean  change(  int[]  course  )  {
      try  {
         System.out.println( "Start change"  );
         course[ 10 ]  =  1;
      }  
      catch  (ArrayIndexOutOfBoundsException e) {
         course[ 10 ]  =  1;
         System.err.println( "OutOfBounds: " );
         return  true;
      }   
      finally   {
         System.out.println(  "In Final Block"  );
      }
      return  false;
   };

   public  static  void  main( String args[] ) {
      try  {
         int  students[] = new int[5];
         System.out.println( "Main"  );
         System.out.println(  change( students )  );
         System.out.println(  "After Change"  );
      }
      catch  (ArrayIndexOutOfBoundsException e) {
         System.out.println( "Over Here" );
      }
   }
}
Output
Main
Start change
In Final Block
Over Here

Doc 12, Exceptions Slide # 26Listen Here!

Final Block - For Clean Up


class  FinalBlockWithExceptionCalled  
{
   public static void main( String args[] ) 
   {
      int  students[] = new int[5];

      try  
      {
         System.out.println( "Start Try"  );
         students[  10  ]  =  1;
         System.out.println(  "After array statement"  );
      }

      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
      }

      finally
      {
         System.out.println(  "In Final Block"  );
      }

      System.out.println(  " After try " );
   }
}
Output
OutOfBounds: 10
In Final Block
After try

Doc 12, Exceptions Slide # 27Listen Here!
Final Block - Always Called

class  FinalBlockExceptionNotCalled  
{
   public static void main( String args[] ) 
   {
      int  students[] = new int[5];

      try  
      {
         System.out.println( "Start Try"  );
         students[  2  ]  =  1;
         System.out.println(  "After array statement"  );
      }  

      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "OutOfBounds: "  +  e.getMessage());
      }   

      finally   
      {
         System.out.println(  "In Final Block"  );
      }

      System.out.println(  " After try "  );
   }
}
Output
Start Try
After array statement
In Final Block
After try

Doc 12, Exceptions Slide # 28Listen Here!
Can't Escape Finally

class  ExceptionFunction  
{
   public  static  boolean  change(  int[]  course  )  
   {
      try  
      {
         System.out.println( "Start change"  );
         course[ 10 ]  =  1;
         System.out.println( "End Change"  );
      }  
      catch  (ArrayIndexOutOfBoundsException e) 
      {
         System.err.println( "OutOfBounds: " );
         return  true;
      }   
      finally   
      {
         System.out.println(  "In Final Block"  );
      }
      return  false;
   };

   public  static  void  main( String args[] ) 
   {
      int  students[] = new int[5];
      System.out.println( "Main"  );
      System.out.println(  change( students )  );
      System.out.println(  "After Change"  );
   }
}
Output
Main   In Final Block
Start Change   true
OutOfBounds:   After Change

Doc 12, Exceptions Slide # 29Listen Here!

What information is passed to the handler?


Two pieces of information are standard
Message
Stack Info

When you define your own exceptions you can add more data if needed
class  FindHandlerSimpleExample  {
   public  static  void  change(  int[]  course  )  {
      course[ 10 ]  =  1;
   };

   public  static  void  main( String args[] ) {
      int  students[] = new int[5];
      try  {
         change( students );
      }  
      catch  (ArrayIndexOutOfBoundsException e)  {
         System.err.println( "Message: "  +  e.getMessage()  );
         System.err.println( "Stack: "  +  e.printStackTrace()  );
      }   
   }
}
Output
Message: 10
java.lang.ArrayIndexOutOfBoundsException: 10
at test.change(All.java:7)
at test.main(All.java:13)

Doc 12, Exceptions Slide # 30Listen Here!

User Defined Exceptions

class  BoringLectureException  extends  Exception  {

   public  BoringLectureException()  {
      super();
   }

   public  BoringLectureException( String  errorMessage )  {
      super(  errorMessage  );
   }
}


class  NewExceptionTest  {

   public static void dullSpeaker() throws BoringLectureException {
      // Code can go here
      throw  new  BoringLectureException(  "Change Topics"  );
   }

   public  static  void  main(  String  args[]  )   {

      try  {
         dullSpeaker();

      } catch  (  BoringLectureException  e  )  {

         System.err.println( "Error: Time to "  +  e.getMessage() );
      }
   }
}
Output
Error: Time to Change Topics

Doc 12, Exceptions Slide # 31Listen Here!

Tips on Using Exceptions


1 Use exceptions for exceptional conditions, not simple tests
Good
Stack accountHistory;

if ( accountHistory.isEmpty() == false )
   accountHistory.pop();


Not so Good
try
   {
   accountHistory.pop();
   }
catch ( EmptyStackException doNothing )
   {
   }


Doc 12, Exceptions Slide # 32Listen Here!
A try for every line, and every line for a Try?

2. Don't Micro manage Exceptions
bad
try
   {
   amount = accountHistory.pop();
   }
catch ( EmptyStackException doNothing )
   {
   amount = -1;
   }
try
   {
   out.writeFloat( amount );
   }
catch ( IOException ioError )
   {
   System.err.out( "problem writing to file" );
   }
Better
try
   {
   amount = accountHistory.pop();
   out.writeFloat( amount );
   }
catch ( EmptyStackException doNothing )
   {
   }
catch ( IOException ioError )
   {
   System.err.out( "problem writing to file" );
   }

Doc 12, Exceptions Slide # 33Listen Here!
Free Speech for Exceptions!

3 Don't Squelch Exceptions
Bad
try
   {
   amount = accountHistory.pop();
   out.writeFloat( amount );
   
   // a bunch more code that can throw various exceptions

   }
catch ( Exception dontBotherMeWithExceptions )
   {
   }



4 Catch Exceptions
public static void main( String[] args ) throws Exception
   {
   // Lots of stuff here
   }

Doc 12, Exceptions Slide # 34Listen Here!

List of All Built-in Exceptions

AWTExceptionInstantiationException
ArithmeticExceptionInterruptedException
ArrayIndexOutOfBoundsExceptionInterruptedIOException
ArrayStoreExceptionMalformedURLException
ClassCastExceptionNegativeArraysizeException
ClassNotFoundExceptionNoSuchElementException
CloneNotSupportedExceptionNoSuchMethodException
EOFExceptionNullPointerException
EmptyStackExceptionNumberFormatException
ExceptionProtocolException
FileNotFoundExceptionRuntimeException
IOExceptionSecurityException
IllegalAccessExceptionSocketException
IllegalArgumentExceptionStringIndexOutOfBoundsException
IllegalMonitorStateExceptionUTFDataFormatException
IllegalThreadStateExceptionUnknownHostException
IndexOutOfBoundsExceptionUnknownServiceException
Errors
AWTErrorLinkageErrorNoClassDefFoundError
AbstractMethodErrorNoSuchFieldErrorNoSuchMethodError
ClassCircularityErrorOutOfMemoryError
ClassFormatErrorErrorStackOverflowError
IllegalAccessErrorUnknownError
IncompatibleClassChangeErrorUnsatisfiedLinkErrorVerifyError
InstantiationErrorInternalErrorVirtualMachineError

----------