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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How to print nodes of a Binary tree?

2017


What is the synchronized method modifier?

876


What is stack example?

791


How can you say java is object oriented?

841


What is a local, member and a class variable?

807


What is downcasting?

815


Is java jre still free?

735


What is java util collection?

777


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

751


What do you mean by stream pipelining in java 8?

977


What is Enum in Java?

919


Describe the term diamond problem.

791


Variables used in a switch statement can be used with which datatypes?

753


What are the different types of data structures in java?

756


What is the base class in java from which all classes are derived?

759