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

Does every java program need a main?

781


What are identifiers in java?

817


Should you use singleton pattern?

735


What is parse method?

777


if u open login & logout ,how can udisplay the timelogin & logout members ?

1980


What is the difference between the paint() and repaint() methods?

824


what is anonymous class in java?

785


Can we override final method?

771


Why are variables important in research?

761


Define an applet in java?

858


How to obtain a performance profile of java program

784


Difference between overriding and overloading in java?

848


What is lifetime variable?

754


Is 0 true or is 1 true?

724


What is vector?

788