Difference between error and exception

Answers were Sorted based on User's Feedback



Difference between error and exception..

Answer / rams

The mistakes in the syntax are resulted as errors
the mistakes in the logic of a program resulted as exceptions.

Is This Answer Correct ?    16 Yes 1 No

Difference between error and exception..

Answer / modi

An error is an irrecoverable condition occurring at runtime.
Such as OutOfMemory error. These JVM errors and you can not
repair them at runtime. While exceptions are conditions that
occur because of bad input etc. e.g. FileNotFoundException
will be thrown if the specified file does not exist. Or a
NullPointerException will take place if you try using a null
reference. In most of the cases it is possible to recover
from an exception (probably by giving user a feedback for
entering proper values etc.).

Is This Answer Correct ?    3 Yes 0 No

Difference between error and exception..

Answer / chitraraman

Error in java means the mistake done buy the programmer
logically or syntatically.
Exception is an error thrown by java impllctly like
IOException,Array out of bound Exception

Is This Answer Correct ?    2 Yes 2 No

Difference between error and exception..

Answer / Khushboo Shobhit

An error refers to a mistake or problem that occurs during program execution, while an exception is a specific type of error that can be caught and handled by the program. Errors may result in unexpected behavior or termination of the program, while exceptions allow for proper handling and recovery.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is a parameter in matrices?

1 Answers  


what happens when a thread cannot acquire a lock on an object? : Java thread

1 Answers  


What are the different types of inheritance in java?

1 Answers  


How do you write methodology?

1 Answers  


What best practices should you follow while writing multithreaded code in java?

1 Answers  


Why should I use abstract class?

1 Answers  


How to create an immutable class?

1 Answers  


What is mnemonic in assembly language?

1 Answers  


Is java a super set of javascript?

1 Answers  


What do you understand by a Static Variable?

1 Answers   CGI,


Differentiate between array list and vector in java.

1 Answers  


What is the purpose of finalization?

4 Answers  


Categories