Static code blocks

前端 未结 5 2116
遇见更好的自我
遇见更好的自我 2021-02-06 19:56

Going from Java to C# I have the following question: In java I could do the following:

public class Application {
    static int attrib         


        
5条回答
  •  执念已碎
    2021-02-06 20:52

    You just can write a static constructor block like this,

    static Application(){
     attribute=5;
    }
    

    This is what I could think of.

提交回复
热议问题