• 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 kicking out of program

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to my idea if we catch exceptions then some "fatal" exceptions will terminate the program after catch/finally execution. Some exceptions continue the execution after catching.
Exceptions like Filenotfound etc... are not fatal.execution can continue after catching that exception.
Here what exceptions are fatal and what are not? All Unchecked exceptions and Errors are Fatal?
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yamini,
You can think about exceptions as being one of three types:
  • Errors you expect to happen at some point. You should handle these. Most of the time these will be direct subclasses of Exception, but not RuntimeException, so the compiler will force you to catch or declare these.
  • Errors you know may happen, but don't expect. These are the RuntimeException-subclasses exceptions. You generally don't worry about these unless there are specific instances that you might want to cover (like NumberFormatException) if explicity stated by functions. Sometimes you won't even know what RuntimeExceptions can be thrown by code you call.
  • Lastly, there are the RuntimeErrors that can be thrown. These usually deal with things way out of your control, so you just let them do whatever they want. Examples being running out of memory or other JVM issues.

  • To answer your question though: any unchecked exception that isn't caught and handled by some catch block somewhere will force the JVM to quit with the usual stack trace and chaos.
    [ April 16, 2004: Message edited by: Nathaniel Stoddard ]
     
    When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic