what is difference between Exception and Error?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java util concurrentmodificationexception?

481


How can I debug the Java security exceptions and AccessControlExceptions?

617


Why java is not 100% object-oriented?

809


What are the four versions of java?

533


What are the differences between abstract class and interface?

498






What are the various access specifiers in java?

551


What is substring 1 in java?

579


What is the size of arraylist in java?

594


Is array dynamic in java?

468


There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

976


How to split a string in java?

611


what is the major difference between linkedlist and arraylist in java?

538


How does predicate work in java?

521


Name component subclasses that support painting in java programming?

614


What does function identity () do?

502