what is difference between Exception and Error?

Answer Posted / sandeep tyagi

The functional diiference, in terms of the compiler, is
that you don't have to declare errors in throws clauses on
methods, or catch them.

Conceptually, an Error means something has gone wrong with
your program, which should usually give up and crash,
whereas an exception is for an unusual situation that you,
as a programmer, anticipated as a possibilty. So, for
example, a divide-by-zero is an Error, but attempting to
read a file and finding it doesn't exist is an Exception.

Is This Answer Correct ?    78 Yes 55 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you differentiate abstract class from interface?

523


What modifiers may be used with a top-level class?

571


What is string array?

572


What are the differences between c++ and java?

579


What is the current version of java?

537






Differentiate between stringbuffer and stringbuilder in java.

550


What is thread count in java?

543


What is an object's lock and which object's have locks in java programming?

563


What does it mean to be immutable?

544


How will you reverse a singly-link list?

591


What is linkedlist in java?

502


List some important characteristics on jre

590


What is the difference between throw and throws in java?

548


Why is static used?

545


Is break statement can be used as labels in java?

500