Can I Use static block in C#

Is there a way to use static block as in Java like: static { /////code /////code }

1 Reply

RP Ramesh Praveen Syncfusion Team June 25, 2003 11:36 AM UTC

No, this is not supported. You could however specify static constructors for a class. They will be executed if and when that type is accessed by the runtime. -Praveen

Loader.
Up arrow icon