AmbitionBox
Discover Best Places to work in India
Discover best places to work
Compare & find best workplace
Bring your workplace to life
Highlight your company's perks
Read reviews for 6L+ companies
Rate your former or current company
Discover salaries for 8L+ companies
Calculate your take home salary
Check your market value
Help other jobseekers
Read interviews for 90K+ companies
Interviews questions for 1K+ colleges
Contribute your interview questions
C# Programming
Which among the following is NOT considered as .NET Exception class?
Exception
StackUnderflow Exception
File Found Exception
Divide By zero Exception
Answer: Option (B) and Option (C)
Select the statements which describe the correct usage of exception handling over conventional error handling approaches?
As errors can be ignored but exceptions cannot be ignored
Exception handling allows separation of program’s logic from error handling logic making software more reliable and maintainable
try – catch – finally structure allows guaranteed cleanup in event of errors under all circumstances
All of the above mentioned
Answer: Option (D)
Which among the following is NOT an exception?
Stack Overflow
Arithmetic Overflow or underflow
Incorrect Arithmetic Expression
Answer: Option (C)
Which of the following is the correct statement about exception handling in C#.NET?
finally clause is used to perform cleanup operations of closing network and database connections
a program can contain multiple finally clauses
The statement in final clause will get executed no matter whether an exception occurs or not
Answer: Option (A) and Option (C)
Which of these keywords is not a part of exception handling?
try
finally
thrown
catch
Exception handling is managed via 5 keywords – try, catch, throws, throw and finally.
Choose the correct output for the given set of code:
class program
{
staticvoid main(string[] args)
int i =5;
int v =40;
int[] p =newint[4];
p[i]= v;
}
catch(IndexOutOfRangeException e)
Console.WriteLine("Index out of bounds");
Console.WriteLine("Remaining program");
value 40 will be assigned to a[5];
The output will be : Index out of bounds Remaining program
The output will be : Remaining program
None of the above mentioned
Answer: Option (B)
staticvoid Main(string[] args)
Console.WriteLine("csharp"+" "+1/Convert.ToInt32(0));
catch(ArithmeticException e)
Console.WriteLine("Java");
Console.ReadLine();
csharp
java
Run time error
csharp 0
1 / 0, hence system out of flow exception error.
Join India’s largest community to research company culture
Are you a student or working professional?
Student/Never worked
I am a student/I have never worked
Working Professional
I am working/I have worked before
What are your preferred job locations?
Popular Cities
Other Cities
Follow your preferred designations/job profiles
Suggestions based on your job profile
vs
Similar Companies