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
Enlist some of the properties of a thread class?
In gridview in editmode if we want to display information in one combobox based on
Is struct object oriented?
What are the steps for creating clr trigger
What is a destructor in c#?
Is std :: string null terminated?
What is the c# equivalent of c++ catch (...), Which was a catch-all statement for any possible exception?
What are the examples of data types?
How do you use nullable?
Why dataset is used in c#?
What is protected internal modifier in C#?
What are the different types of literals in c#?
What is the reason behind the invention of c#?
What is a jagged array?
How can you prevent escaping on backslashes in C# with string definitions?