Saturday, 8 June 2013

C# Interview Questions

1. What are the main properties of object oriented programming?
 There are mainly 3 properties

  1. Encapsulation/Abstraction
  2. Inheritance
  3. Polymorphism
2. What is encapsulation?
a ) This gives a way to hide the internal details of an object from its users.

3. What is inheritance ?
a ) It provides a way to build/create new classes using existing classes.

4. What is polymorphism?
a ) It provides a way to take more than one form.

5. What is a constructor?
a ) Constructor enables an object to initialize itself when it is first created.

6. What are the properties of a constructor?
a ) They are
  1. They should have the same name as that of a class
  2. They do not specify a return type.
  3. we can use access modifiers to constructor.
7. How many types of access modifiers are there ?
a ) 5 types
  1. Private
  2. Public
  3. Protected
  4. Internal
  5. Protected Internal
8. What access modifiers we can use for a class?
a ) We can use 2 access modifiers
  1. Public
  2. Internal
9. What is the default access modifier of a class?
a ) It is Internal

10. What is the default access modifier for class members?
a ) It is Private