what is difference between Exception and Error?

Answers were Sorted based on User's Feedback



what is difference between Exception and Error?..

Answer / manikandan

Error occurs at runtime and cannot be recovered, Outofmemory
is one such example. Exceptions on the other hand are due
conditions which the application encounters such as
FileNotFound exception,ArrayIndexOutofBountException etc.

Is This Answer Correct ?    1 Yes 1 No

what is difference between Exception and Error?..

Answer / chandra sekhar dash

Exceptions are also one kind of errors which we can hadle at
both compile time and run time by using try and catch
blocks.
These are two types: Compile time and runtime.
Sql and IO Exceptions come under compile time
ArrayIndexOutofbounds and NullPointer these come under
runtime Exceptions

Errors are the problems which we cant hadle, like stack
overflow and memoryoutofbounds etc.,these generally comes at
compile time

Is This Answer Correct ?    0 Yes 0 No

what is difference between Exception and Error?..

Answer / ranjan singh

Errors-"this error occur because of user which is make some error in application".
Exception-"it is unpredictable error occured during run time."

Is This Answer Correct ?    0 Yes 0 No

what is difference between Exception and Error?..

Answer / sushma

Exception- This class is used for exceptional conditions that user programs should catch.

Error- It defines exceptions that are not expected to be caught under normal circumstances by your program.

Is This Answer Correct ?    1 Yes 1 No

what is difference between Exception and Error?..

Answer / shabana

n general error is which nobody can control or guess when it
occurs.Exception can be guessed and can be handled. In Java
Exception and Error are sub class of Throwable.It is
differentiated based on the program control.Error such as
OutOfMemory Error which no programmer can guess and can
handle it.It depends on dynamically based on architectire,OS
and server configuration.Where as Exception programmer can
handle it and can avoid application's misbehavior.For
example if your code is looking for a file which is not
available then IOException is thrown.Such instances
programmer can guess and can handle it.

Is This Answer Correct ?    0 Yes 0 No

what is difference between Exception and Error?..

Answer / md.tanweer alam

ERROR:-error may occur internaly in the program code through
the resources the program trying to access.
the source of error may be user input error such as giving a
wrong URL device erroe such as printer not ready physical
limitation such as disk full or memory not enough and code
error like arroay index out of bound trying to access an
empty stack and divide by zero error..
EXCEPTION:-all these above mention errors occuring in
abnormal condition called exception

Is This Answer Correct ?    0 Yes 0 No

what is difference between Exception and Error?..

Answer / ritesh srivastav

1 exception is a condition that has been occur in piece of code. that can be handle by programmer.
whereas error is occur at runtime of program.that can not be handle by programmer.
2 eg. of exception is no divide by zero
whereas eg. of error is stack over flow.

Is This Answer Correct ?    0 Yes 0 No

what is difference between Exception and Error?..

Answer / ajit kumar dubey

an event occur during execution time, is called exception
when ur program compile then that time event occur is
called error.

Is This Answer Correct ?    6 Yes 7 No

what is difference between Exception and Error?..

Answer / boopathy

Error : Something goes wrong in our application/program ,
that leads to crash your output/logic is called as error.
the error may be of syntatic error or error which can
easily identify the programmer.

Exception : during the execution(runtime) of our
application/program, the system leads to something wrong
statements like 'system out of memory' 'out of arguments'
called Exception.

Exceptions can easily handle by lot of exception handler in
c# classes(Framework class libraries). Normally C# have 20
different types of exception handler. they are
Exception Class Cause
SystemException A failed run-time check;used as a base
class for other.
AccessException Failure to access a type member, such as a
method or field.
ArgumentException An argument to a method was invalid.
ArgumentNullException A null argument was passed to a
method that doesn't accept it.
ArgumentOutOfRangeException Argument value is out of
range.
ArithmeticException Arithmetic over - or underflow has
occurred.
ArrayTypeMismatchException Attempt to store the wrong type
of object in an array.
BadImageFormatException Image is in the wrong format.
CoreException Base class for exceptions thrown by the
runtime.
DivideByZeroException An attempt was made to divide by
zero.
FormatException The format of an argument is wrong.
IndexOutOfRangeException An array index is out of bounds.
InvalidCastExpression An attempt was made to cast to an
invalid class.
InvalidOperationException A method was called at an
invalid time.
MissingMemberException An invalid version of a DLL was
accessed.
NotFiniteNumberException A number is not valid.
NotSupportedException Indicates sthat a method is not
implemented by a class.
NullReferenceException Attempt to use an unassigned
reference.
OutOfMemoryException Not enough memory to continue
execution.
StackOverflowException A stack has overflown.

Is This Answer Correct ?    19 Yes 22 No

what is difference between Exception and Error?..

Answer / paletipatisrinu

Error : Something goes wrong in our application/program ,
that leads to crash your output/logic is called as error.
the error may be of syntatic error or error which can
easily identify the programmer.

Exception:its unwanted and unexpeceted event its disturb the
normal flow of program execution.
Exception is an object it occurs at run time it
gives system error message and then convert system error
message into user friendly messages

Is This Answer Correct ?    9 Yes 12 No

Post New Answer

More Core Java Interview Questions

What is meant by class?

0 Answers  


Is linkedlist thread safe in java?

0 Answers  


What is the difference between add() and addElement() method in Vector Class ?

2 Answers   TCS,


What are multiple inheritances?

0 Answers  


write a class to input 2 points by the user & check the line maked by the points is horizontal,vertical or rectangle?

1 Answers  






To set the position and size of a component, which methods are used?

3 Answers  


Can a function return a function?

0 Answers  


How many wrapper classes are there in java?

0 Answers  


Compare Mutex and Semaphore in java.

0 Answers   Ciena,


What is the difference between an interface and an abstract class?

0 Answers   Cyient,


What is jvm? Why is java called the platform independent programming language?

0 Answers  


Why does java doesnot support multiple inheritance?

5 Answers   TCS,


Categories