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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / janet

The exception class defines mild error conditions that your
program encounters.
Ex: Arithmetic Exception,FileNotFound Exception

Exception can occur when
--> Try to open the file,which does not exist
--> the network connection is disrupted.
--> operands being manipulated are out of prescribed
ranges.
--> the class file you are interested in loading is
missing.
The error class defines serious error conditions that
you should not attempt to recover from .in most cases it is
advisable to let the program terminate when such an error
is encountered.
Ex. Running out of memory error,stack overflow error.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Core Java Interview Questions

System.out & System.in are final static data member of System class but we can change there reference through setOut() & setIn() method how...

2 Answers   FCS, TCS,


What Is Resource Leak?

2 Answers  


is JVM platform dependent or independent..?

11 Answers   IBM, Tech Mahindra,


What are the approaches that you will follow for making a program very efficient?

0 Answers  


Name some classes present in java.util.regex package.

0 Answers  






Is it possible to override the main method?

0 Answers  


What is the difference between the ">>" and " >>>" operators in java?

0 Answers  


What 4 doubled?

0 Answers  


Does 'true' and 'false' are keywords?

5 Answers  


What is meant by 'bit masking' in java?

0 Answers   DELL,


Difference between Preemptive scheduling vs. Time slicing?

0 Answers  


What is mysql driver class name?

0 Answers  


Categories