1.

Give 2 Scenarios Where Static Constructors Can Be Used?

Answer»

1. A typical USE of static CONSTRUCTORS is when the class is USING a LOG file and the constructor is used to write entries to this file.
2. Static constructors are also useful when creating wrapper classes for UNMANAGED code, when the constructor can call the LoadLibrary method.

1. A typical use of static constructors is when the class is using a log file and the constructor is used to write entries to this file.
2. Static constructors are also useful when creating wrapper classes for unmanaged code, when the constructor can call the LoadLibrary method.



Discussion

No Comment Found