SDSU CS 535: Object-Oriented Programming & Design
Fall Semester, 1997
Doc 16, Exceptions

To Lecture Notes Index
San Diego State University -- This page last updated 09-Oct-97

Contents of Doc 16, 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 Java 1.0 Built-in Exceptions

References



The Java Programming Language, Arnold and Gosling, Chapter 7







Doc 16, Exceptions Slide # 1

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 16, Exceptions Slide # 2
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 16, Exceptions Slide # 3
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 16, Exceptions Slide # 4

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 16, Exceptions Slide # 5

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 16, Exceptions Slide # 6

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 16, Exceptions Slide # 7
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 16, Exceptions Slide # 8
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 16, Exceptions Slide # 9
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 16, Exceptions Slide # 10

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 16, Exceptions Slide # 11

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 16, Exceptions Slide # 12
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 16, Exceptions Slide # 13
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 16, Exceptions Slide # 14
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 16, Exceptions Slide # 15

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 16, Exceptions Slide # 16
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 16, Exceptions Slide # 17
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 16, Exceptions Slide # 18
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 16, Exceptions Slide # 19

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 16, Exceptions Slide # 20
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 16, Exceptions Slide # 21
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 16, Exceptions Slide # 22
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 16, Exceptions Slide # 23

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 16, Exceptions Slide # 24

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 16, Exceptions Slide # 25
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 16, Exceptions Slide # 26
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 16, Exceptions Slide # 27
Finally is Master

A finally block is entered with a reason, such as end of the method, an exception was thrown

If the finally block creates it own reason to leave ( throws an exception, executes a return or break) then the original reason is forgotten
class  FinalExample
   {
   public static void explainThis()
      {
      int  students[] = new int[5];
      try  
         {
         System.out.println( "Start Try"  );
         students[  10  ]  =  1;
         }  
      finally   
         {
         System.out.println(  "In Final Block"  );
         return;
         }
      }
      
   public  static  void  main( String  args[]  )
      {
      try
         {
         explainThis();
         }
      catch  (ArrayIndexOutOfBoundsException missed) 
         {
         System.out.println(  "In ArrayIndexOutOfBoundsException"  );
         }
      System.out.println(  "After try in main"  );
      }
   }
Output
Start Try
In Final Block
After try in main

Doc 16, Exceptions Slide # 28
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 16, Exceptions Slide # 29

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 16, Exceptions Slide # 30
Exceptions and Inheritance
The rule
A method that overrides another method may not be declared to throw more checked exceptions than the overridden method
The Details
Let class Child be a subclass of class Parent

Let foo be a method of Parent that is overridden by child

If Child.foo has a throws clause that mentions any checked exceptions, then Parent.foo must have a throws clause.

For every checked exception listed in Child.foo, that same exception class or one of its superclasses must occur in the throws clause of Parent.foo
class Parent
   {
   public void foo() throws IOException {};

   public void bar() {};
   }

class Child extends Parent
   {
   public void foo() {};         // OK

   public void bar() throws IOException{};   // Compile Error
   }


Doc 16, Exceptions Slide # 31

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 16, Exceptions Slide # 32

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 16, Exceptions Slide # 33
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 16, Exceptions Slide # 34
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 16, Exceptions Slide # 35

List of All Java 1.0 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


visitors since 09-Oct-97