go to previous page   go to home page   go to next page

Answer:

The string that was an argument to the constructor.


Making an Exception

There are two constructors for Exception:

Exception()

and

Exception( String str )

The string supplied to the second form can later be extracted from the object using its getMessage() method. Usually a method should construct and throw an exception all in one statement:

if ( some problem )
  throw new Exception("Informative Message" ) ;

QUESTION 12:

Since Exception is not a final class, can it be extended?


go to previous page   go to home page   go to next page