We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

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

Live Chat Icon For mobile
Up arrow icon