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

Do extension methods have to be static?

951


What is a console operator?

841


What is the use of console readkey in c#?

872


Why is aws serverless?

836


What is difference between private, protected, and public in C#?

990


What is delegate in c# interview questions?

937


What is the purpose of dependency injection?

865


What is the value which is accepted by all data types ?

942


What is the different types of private assembly and shared assembly?

937


Can you create partial delegates and enumerations?

974


What is type cast in C#?

947


What is default method in c#?

951


How do you read an Excel sheet in C#?

934


Can property be private in c#?

826


What is the difference between an integer and int?

851