Tag Archives: C# Interview Questions

C# Interview Questions And Answers: part-2

 

Ques 1. Why is it a bad idea to throw your own exceptions?
Ans : Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.

 

Ques 2. What’s a delegate?
Ans : A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

 

Ques 3. What’s a multicast delegate?
Ans : It’s a delegate that points to and eventually fires off several methods.

 

Ques 4. How’s the DLL Hell problem solved in .NET? Continue reading C# Interview Questions And Answers: part-2

C# Interview Questions And Answers: part-1

Ques 1. What’s the implicit name of the parameter that gets passed into the class’ set method?
Ans : Value, and its datatype depends on whatever variable we’re changing.

Ques 2. How do you inherit from a class in C#?
Ans : Place a colon and then the name of the base class. Notice that it’s double colon in C++.

Ques 3. Does C# support multiple inheritance?
Ans : No, use interfaces instead.

Ques 4. When you inherit a protected class-level variable, who is it available to?
Ans : Classes in the same namespace.

Ques 5. Are private class-level variables inherited? Continue reading C# Interview Questions And Answers: part-1