Set - 5

Question 1 :

Can you change the value of a variable while debugging a C# application?

Answer :

Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.

Question 2 :

Are private class-level variables inherited?

Answer :

Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.

Question 3 :

Can you inherit multiple interfaces?

Answer :

Yes. .NET does support multiple interfaces.

Question 4 :

From a versioning perspective, what are the drawbacks of extending an interface as opposed to extending a class?

Answer :

With regard to versioning, interfaces are less flexible than classes. With a class, you can ship version 1 and then, in version 2, decide to add another method. As long as the method is not abstract (i.e., as long as you provide a default implementation of the method), any existing derived classes continue to function with no changes. Because interfaces do not support implementation inheritance, this same pattern does not hold for interfaces. Adding a method to an interface is like adding an abstract method to a base class--any class that implements the interface will break, because the class doesn't implement the new interface method.

Question 5 :

Which one is trusted and which one is untrusted?

Answer :

Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction