Give 2 scenarios where static constructors can be used?



Give 2 scenarios where static constructors can be used?..

Answer / Nikunj Kumar

"1) When a class needs to perform some initialization before any instances of the class are created. 2) When a class has dependencies on other classes, and these dependencies need to be initialized before the class itself."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is a dynamic assembly?

1 Answers  


Can you specify nested classes as partial classes?

1 Answers  


What is tpl in c#?

1 Answers  


What is semaphore in c#?

1 Answers  


In which way a two-dimensional array declared in C#?

1 Answers   Siebel,


What is reference types in c#?

1 Answers  


Can property defined in Interface.

4 Answers   Synechron,


What are the different types of comments in c#?

1 Answers  


What is Interface? Explain with an example.

8 Answers   TCS,


What is anonymous class in c#?

1 Answers  


Can we inherit a private class in chsarp? how? explain(with code) ?

4 Answers   Techno Labs,


What is CASPOL?

1 Answers   MCN Solutions,


Categories