• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exceptions

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are unchecked exceptions in Java? :roll:
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Throwable
|---Error
|---Exception
----|
----|---RuntimeException
----|---InterruptedException
----|---IOException
Except for RuntimeException, Error and their subclasses, all exceptions are called checked exceptions.
Unchecked exceptions cannot be predicted before hand and your code will compile even if you don't catch the exception. But if runtime if your code throws the exception...then that thrown exception will move up in the exception stack till it reaches the parent class and the thread will die if the exception is not handled at all, and that exception is handled by default exception handler. The example of unchecked exception is ArrayIndexOutOfBoundsException
In case of checked exceptions the method must either catch the exception and take the appropriate action, or pass on the exception to its caller. IOException is an example of Checked Exception.
I hope this clears ur doubt.
[ September 02, 2003: Message edited by: Manish Sachdev ]
reply
    Bookmark Topic Watch Topic
  • New Topic