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

What are the standards to place package statement within a source code file?

1 Answers  


What is data member in java?

0 Answers  


How many types of syncronization?

2 Answers  


Can we have multiple classes in a single file?

0 Answers  


1.) if we use "private" in place of "public" in public static void main()... 2.) if we use "int" in place of "void".... 3.) can we ommit "static" keyword from that statement.... 4.) also can we give the command line arguments type as int type or float,etc.(.i.e (string args[]))

1 Answers  






What is the purpose of the finally clause?

3 Answers  


What is bool mean?

0 Answers  


Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situations (in general) would you use a HashSet to store a collection of values?

1 Answers  


what is the final keyword denotes in java?

0 Answers   IBS,


What is parsing a sentence?

0 Answers  


How Vector class is synchronized,How to build user defined class as synchronized?

0 Answers  


What if constructor is protected in java?

0 Answers  


Categories