What is exception and error? and what is the difference
between them?

Answer Posted / krishnakanth

Exception and Errors are two subclasses of Throwable Class.

Exception:-Exception can be devided into two other groups.

Checked Exceptions and Unchecked Exceptions.

Checked Exceptions are the User defined exceptions and it
must be caught by the user.(Eg:IOException etc.)

Unchecked Exceptions are the subclasses of Runtime
Exception.(Eg:FileNotFound Exception,Division by Zero etc.)

Errors:-Errors are the external interrupts that terminates
the execution of the program.That means Errors ate out of
user control.It can't be catched by the user.(Eg:
OutOfMemory Exception etc.)

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why vector class is used?

725


When would you use a static class?

764


What is nextint java?

753


What are filterstreams?

834


Can the interface be final?

768


Break statement can be used as labels in java?

771


Which collection allows duplicate values in java?

747


What is the purpose of skeleton and stub?

821


how to create constants in java?

833


Why generics are used in java?

775


What does string [] args mean?

750


Give the hierarchy of inputstream and outputstream classes.

824


What does index mean in java?

744


What is identifier in java?

785


Is there a sort function in java?

770