What is Class

Class is user defined data type which is used to analyse what the entity is. It is basically a blueprint.

What is object

Object is the memory which is allocated for the given class. in other word it is the runtime entity of class.

Object is also known as instance of the class.

Que 3:- what is the default access modifier of class

Default access modifier of class is Internal.

Que 4 what is the default access modifier of member of class

Default access modifier of class members is private.

Que 5 what is constructor

Constructor is the special type of method which is used to initialize the class member variable at the time of object creation.

For Detail Click Here

Que 6 what is the type of constructor

There are two types of constructor and these are as follows:-

  • Static Constructor
  • Non-Static Constructor

No static constructor further categorized into following type

  • Default constructor
  • Parametrized constructor
  • Copy constructor
For Detail Click Here

Que 7 if a class do not contain any constructor then which constructor called

If a class do not contain any constructor then default constructor will be called.

Que 8 what is constructor chaining?

Constructor chaining is the process of calling a constructor from another constructor. When we call same class constructor we use this keyword and when we call base class constructor we use base keyword.

For Detail Click Here

Que 9 can we overload static constructor

No. we cannot overload static constructor as static constructor is parameter less constructor.

Que 10 What is difference between static constructor and non-static constructor

  • Static constructor can only initialize static variable but non static constructor can initialize both static and non-static variable.
  • Non-static constructor can have access modifier but static constructor have no access modifier.
  • Static constructor is parameter less constructor but we can pass parameter to non-static constructor.