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
What is property c#?
List down the fundamental oop concepts?
What are partial classes and use of partial classes?
What is xml serialization in c#?
How to use exception handling in stored procedure?
Explain hash table in c# ?
Can we call server-side code (c# or vb.net code) from javascript?
What is deferred execution in c#?
Explain the functionalities of satellite assembly?
What is a clr (common language runtime)?
What is a collection class in c#?
What are the Types of values mode can hold session state in web.config
What is disco?
Define satellite Assembly?
What is call back method?