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

What is a function easy definition?

515


What are multiple inheritances? Is it supported by java?

450


Why is multithreading important?

486


How long will it take to learn java?

491


What's the default access specifier for variables and methods of a class?

497






Why array is used in java?

500


What is the difference between jfc & wfc?

582


What is remote method invocation (rmi)?

603


Can classes declared using the abstract keyword cab be instantiated?

550


What is anti pattern in cyber security?

506


Which is bigger float or double?

508


What is java basic concept?

515


Why are lists ordered in java?

530


What is the purpose of nested class in java?

588


What are the basic concepts of OOPS in java?

556