Check your knowledge over Interface in C#, state whether the following statements are True or false:
Continue reading Interview questions on Interface in C#
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# and java both were derived from C++, and therefore they have similar roots, both are widely used for web programming. We discuss the difference between C# and java these are as follows:
Continue reading what is difference between C# and java
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