What Are Properties? Properties are methods that protect access to class members. Properties are class members that provide access to elements of an object or class. Protect access to the state of object. It likes fields, but they operate much like methods. The get and set statements are called accessors. Fields can’t be used in
Month: February 2012
Static Constructor and C# implementation
Static Constructor Instance constructors are used to initialize an object Static constructors are used to initialize a class Will only ever be executed once Run before the first object of that type is created. Have no parameter Do not take an access modifier May co-exist with a class constructor Syntax: class Lion { static Lion()