What is the use of the static constructor? When static
constructor gets compiled?
Answer / 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 |
Why we put script in head of asp.net page Why not in body?
Why does dllimport not work for me?
What is difference between constants and read-only?
What is polymorphism c# example?
what are the events in delegate?
Name some properties of array.
What is string interpolation in c#?
What is datatable in c#?
Did it possible to cast a generic type of derived class to generic type of base class?
code to generate a excel sheet and to write data into it --- -it has to fetch the excel sheet which is in one folder placed by us inside a project folder(i,e it has to create a instance of that excel sheet) and write the data into it row by row please respond as early as possible
How can you overload a method?
What are extender provider components?