What is an Exception? How many exceptions exist in Dot net
and explain them?

Answers were Sorted based on User's Feedback



What is an Exception? How many exceptions exist in Dot net and explain them?..

Answer / manikanta.srinu

Exception is not an error,It's abnmormal
condition.Exceptions will be raise at runtime.if you want
to handle exception,we can use try-catch block.
There are 2 types of exception.
1).System Exception
2).Application Exception
The above two exception are genarated from "Exception" base
class.
SystemException: is meant only for those exceptions defined
by the common language runtime.
Ex:NullReferenceException
ApplicationException: is thrown by a user program.
By using this,we can throws our own exception message.

Is This Answer Correct ?    20 Yes 0 No

What is an Exception? How many exceptions exist in Dot net and explain them?..

Answer / s.malathy

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 ?    7 Yes 1 No

Post New Answer

More Dot Net General Interview Questions

What is an Exception? How many exceptions exist in Dot net and explain them?

2 Answers   CSC, TCS,


What is a system lock?

2 Answers   Wipro,


Explain me what is the difference between a class and an object, and how do these terms relate to each other?

0 Answers  


What is assemblies in .net?

0 Answers  


How does u handle this COM components developed in other programming languages in .NET?

0 Answers  






What is Custom attribute? How to create? Namespace? If I'm having custom attribute in an assembly, how to say that name in the code? What is Reflection in .NET?

3 Answers   Accenture, CC Soft, Infosys,


What are the different types of remote object creation mode in .net?

0 Answers  


Explain clr, cts and cls?

0 Answers  


What is namespaces in .net?

0 Answers  


Is .NET a runtime service or a development platform?

2 Answers  


Differentiate between 'DataSet' and 'SQLDataReader' in ADO.NET?

0 Answers   QuestPond,


Please explain what inheritance is, and why it's important?

0 Answers  


Categories