• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

about Exception Handling

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai friends,

do you know the difference between checked Exceptions and unchecked Exceptions?
 
Ranch Hand
Posts: 180
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch

A checked exception is an exception that is recoverable. The compiler checks that a method that throws it either claims it with the throws keyword or handles it with the try/catch block. An unchecked exception is not recoverable, so the compiler doesn't bother checking.

Take a look at this https://coderanch.com/t/540732/java/java/checked-vs-unchecked-exception#2453372
 
hemu kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you for your replay.

what is an exception?
 
Ogeh Ikem
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An exception is an abnormal situation that can arise in your program. When your program encounters an abnormal situation, it will throw an exception. The JVM will create an instance of java.lang.Exception (or one of it’s subclasses) which encapsulates the abnormal situation. It will then pass (throw) the object as an argument to an appropriate exception handler in the call stack. If you don’t provide an appropriate exception handler yourself, the JVM will look for a default exception handler in the current thread.

Exception handlers can handle java.lang.Throwable objects i.e. all errors and exceptions that can occur in a Java program. In other words, some abnormal situations will cause the JVM to create an instance of java.lang.Error (or one of it’s subclasses), however, you typically won't need to bother with these types of abnormal situations.
 
Your mother was a hamster and your father was a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic