Signupandmakemoney Logo

Pages: [1]   Go Down
  Print  
Author Topic:

Java Training | Java Exceptions | Java Exception Types

 (Read 197 times)
aquanetta
Newbie
*

Karma: 0
Offline Offline

Posts: 2


View Profile
« on: October 03, 2011, 03:02:35 AM »

Java Training | Java Exceptions | Java Exception Types

Java Exceptions:

   A Java exception is an object that describes an error condition occurred in the code.

   When an exception occurs, an object representing that exception is created and thrown in the method that caused the exception.

   That method may choose to handle the exception itself, or pass it on.

   At some point, the exception is caught and processed.

Exception Types:

   All exception types are subclasses of class Throwable.

   The two subclasses of Throwable are Error and Exception.

   There are two types of exceptions in class Exception:

1.   Checked exceptions – When you call a method that throws a checked exception, you must tell the compiler what you are going to do about the exception if it is ever thrown.

2.   Unchecked exceptions – The compiler does not require you to keep track of unchecked exceptions.

   A subclass of Exception is RuntimeException.

   Exceptions belonging to the subclasses of RuntimeException are unchecked expections.

   All other subclasses of the class Exception are checked.

   Exceptions of the type Error are caused by Java run-time environment

   OutofMemoryError is an example of type Error.

   Checked exceptions are due to external circumstances that the programmer cannot prevent. The compiler checks that your program handles these exceptions.

   Unchecked exceptions are programmers’ fault.

Cegonsoft
Register or login to leave a reply or start a topic Logged

Bluesky
Newbie
*

Karma: 0
Offline Offline

Posts: 9


View Profile
« Reply #1 on: May 19, 2012, 07:53:26 PM »

This problem is true,thank you very much !
Register or login to leave a reply or start a topic Logged

Pages: [1]   Go Up
  Print  
 
Jump to: