Home Help Java T Java ?throw? Keyword



Java ?throw? Keyword
Posted on: May 24, 2009 at 12:00 AM
Exceptions are thrown to signal abnormal conditions that can often be handled by some catcher; though it is possible they may not be caught and therefore could result in a dead thread.

Java ?throw? Keyword

     

Exceptions are thrown to signal abnormal conditions that can often be handled by some catcher; though it is possible they may not be caught and therefore could result in a dead thread. Before catching an exception it is must to be thrown first whether by the JVM or by the user itself. So there must be a code somewhere in the program to handle that exception. 

All methods use the throw statement to throw an exception, explicitly within the try block. To throw an exception, the developers use the throw keyword with an object reference as in:

throw new ABCException();   

The type of the reference must be derived from the Throwable class or one of its subclasses.

To know more about "throw" Keyword, browse: 

www.roseindia.net/java/exceptions/how-to-throw-exceptions.shtml

 

Related Tags for Java ?throw? Keyword:
cexceptionjvmiouservmrowhandleforwhereelfprogramtoramselfethrowitusefirstceinmcajcatchmehrprocatssobeforeatisirhalfexceptandcodcodessthstchihatprndodeonomogro


More Tutorials from this section

Ask Questions?    Discuss: Java ?throw? Keyword  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.