REGISTER FREE to Receive Instant Job

Friday, 7 November 2014

Exception Handling in Java

Exception Handling:
Exceptions are those runtime errors which can be handled programmatically in the application. Exception handling adds the features of robustness into the language.

In Java, each runtime error is represented by an object. There exists class JRE for describing runtime errors. At the root of this class hierarchy is an abstract class named Throwable which has 2 non-abstract subclasses named Exception and Error.

Commonly used subclasses of Exception:-

  • ArithmeticException – represents an invalid arithmetical operation such as divide by zero.
  • ArrayIndexOutOfBoundsException – represents an attempt to refer non-existent array elements.
  • NullPointerException – represents an attempt to use a null containing reference variable for referencing object features.
  • NumberFormatException – represents an attempt to correct non-numeric string into a number.

Commonly used subclasses of error – 

  • Virtual Machine Error – represents malfunctioning of JRE.
  • StackOverflowError – represents overflowing of stack.
  • NoSuchMethodError – represents an attempt to invoke a non-existent method.
  • NoClassDefFoundError – represents an attempt to load a non-existent class.

1 comment:

Popular Posts

Powered by Blogger.

About Me

My photo

JobsAcid is a 'job search engine' to provide finding a job on the internet easier for the user. It has designed as huge selection of job offerings on the same search engine.