CSharp Interview Questions

Difference between Static and Instance Constructor ?

Difference between Static and Instance Constructor

The static constructor executes at most once in a given application domain. The execution of a static constructor is triggered by the first of the following events to occur within an application domain:

• An instance of the class type is created.

• Any of the static members of the class type are referenced.

where as

Instance constructor can execute more than once.

Instance constructor executes when an instance of the class type is created.

Leave a Reply