Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the use of the static constructor? When static
constructor gets compiled?

Answer Posted / jitendra

Static constructor is used to initzialise the static data
members when the class has been instantiated first time.
Static data members can certainly be initialized at the
time of their declaration but there are times when value of
one static member may depend upon the value of another
static member. In such cases we definitely need some
mechanism to handle conditional initialization of static
members. To handle such situation, C# provides static
constructor.

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between call by value and call by reference in C#?

1020


What is callback method in c#?

939


What is callback function in c#?

924


What is jit? What are the different types of jit?

1017


What is the object class in c#?

967


What is argument in c#?

930


Why do we use classes?

884


why delegate is type safe?

3005


Where’s global assembly cache located on the system?

1011


What is an enumerator c#?

919


Howmany five tracing levels in System.Diagnostics.TraceSwitcher? Why they are using?

1049


What is a jagged array?

919


How can I access the registry from c# code?

1015


What is before string in c#?

928


Are structs faster than classes?

941