What is exception and error? and what is the difference
between them?
Answers were Sorted based on User's Feedback
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 |
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 |
What is treeset in java collection?
Can static method access instance variables ?
What are the benefits of operations in java?
Can we override static methods in java?
Explain where variables are created in memory?
Will set allow duplicates in java?
How do you know if a value is nan?
my method "abc" return array of interface "xyz" and "pqr" is abstract class implements abc and class "jkl" extends pqr My problem 1) when i call abc it retrun array xyz how can i do this hint xyz refer_xyz = new jkl(); but i can't create array. 2)I want to access method of jkl using reference of xyz??
Does printwriter create a file?
Explain the difference between static and dynamic binding in java?
How do you replace all in word?
what is synchronization? : Java thread