Akshay Patel
What is different between Static Constructor and Private Constructor?
By Akshay Patel in C# on Oct 25 2012
  • Satish Gaikwad
    Sep, 2014 18

    Static Constructor Used to initialize the static members of a class. Can not access non-static members. Executes before the first instance of a class. We can not determine the time of execution. Executes by the CLR not by the object of a class. There are no parameterized static constructors since it is handled by the CLR not by the object. Time of execution might be at the loading of contained assembly. Private Constructor Used to restrict a class to be instantiated and to be inherited. Used whenever a class contains only static members.

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS