Saturday, 21 January 2012
JAVA: What is the difference between error and an exception?
Do you like this Article?
In Java, under Throwable class, there are 2 sub-classes named Exception and Error.
Exception class:
Exception class:
- It is used for exceptional conditions that user programs should catch.
- It's also the class that you will sub-class to create your own custom exception types.
- For example, NullPointerException will be thrown if you try using a null reference.
- It indicates serious problems that a reasonable application should not try to catch.
- It's used by the Java run-time system to indicate errors having to do with the run-time environment, itself.
- For example, stack overflow is an error.
Subscribe to:
Post Comments (Atom)








0 Responses to “JAVA: What is the difference between error and an exception?”
Post a Comment