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

what is object-oriented programming in java?

580


What is array sorting in java?

541


Can an object subclass another object?

547


What are runtime exceptions?

598


Can you add null to a list java?

574






What is a treeset class?

546


How do you achieve singleton?

521


What is bifunction in java?

664


Why collection is called framework in java?

530


Discuss about garbage collector in Java.

631


Explain about doubly linked list

609


What are design patterns and please explain?

562


What is purpose of applet programming?

626


How many bytes is double?

539


What sorting algorithm does javascript use?

522