Pages

Sunday 17 November 2013

Microsoft dotnet interview questions


latest Microsoft interview questions. .net technical

1. difference between virual and abstract methods?
Ans:
Virtual methods must contain implementation whereas abstract methods must not have implementation.
Virtual methods may or may not be overridden in child class whereas abstract methods must be overriden in child class.

2. Can we have virtual constructors?
Ans: No.

3. If we disable the viewstate for the page is the text of textbox retained after postback?
Ans: Yes.

4.What is ViewState?
Ans: ViewState is used to retain property values of control even after postback to the same web form.

5.how to prevent instance of a class to be created?
Ans:
1. make the constructor of the class as private
2. make the class as sealed class.

6. what is the use of constructor?
Ans: To initialize the datamembers of the class.

7. what is abstract class?
Ans: A class with atleast one method declared as abstract and the class must have the abstract keyword.