Set - 4

Question 11 :

What is the difference between const and static read-only?

Answer :

The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case a bit, the containing class can only modify it: -- in the variable declaration (through a variable initializer). 
-- in the static constructor (instance constructors if it's not static).


Question 12 :

What does the parameter Initial Catalog define inside Connection String?

Answer :

The database name to connect to.


Question 13 :

What is the difference between System.String and System.StringBuilder classes?

Answer :

System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.


Question 14 :

What is the top .NET class that everything is derived from?

Answer :

System.Object.

 


Question 15 :

Can you allow class to be inherited, but prevent the method from being over-ridden?

Answer :

Yes, just leave the class public and make the method sealed