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

Do I need to import java.lang package any time? Why?

741


What is isa relationship?

565


How strings are created in java?

569


Explain about interrupt() method of thread class ?

666


What is variable explain with example?

574






What does opcode mean?

541


Can we have try without catch block?

645


What is the static import?

591


What are different types of classloaders?

589


Explain the difference between throw and throws in java?

552


Why char array is favored over string for the storage of passwords?

556


What is variable explain?

528


What is an i/o filter?

569


What does sprintf return?

590


What is identifier give example?

555