1.

Explain The Exception Hierarchy In Java?

Answer»

Throwable class is the super class of all the exception types. Below Throwable class there are two subclasses which DENOTES two distinct branches of exceptions -

  • Exception - An Exception indicates that a problem has OCCURRED, but it is not a serious system problem. The user programs you write will throw and catch Exceptions.
  • Error - It defines exceptions that are not expected to be caught by your program. Exceptions of type Error are used by the Java run-time system to indicate ERRORS having to do with the run-time environment, itself.

Examples of error are StackOverflowError, OutOfMemoryError etc.

Below Exception there is a distinct subclass RunTimeExcpetion - RunTimeExcpetion and its descendants denote the exceptional CONDITIONS that are external to the application, and the application usually cannot anticipate or recover from them.

Throwable class is the super class of all the exception types. Below Throwable class there are two subclasses which denotes two distinct branches of exceptions -

Examples of error are StackOverflowError, OutOfMemoryError etc.

Below Exception there is a distinct subclass RunTimeExcpetion - RunTimeExcpetion and its descendants denote the exceptional conditions that are external to the application, and the application usually cannot anticipate or recover from them.



Discussion

No Comment Found