What is the use of a private static variable in Java?

前端 未结 19 2229
灰色年华
灰色年华 2020-12-02 03:47

If a variable is declared as public static varName;, then I can access it from anywhere as ClassName.varName. I am also aware that static members a

19条回答
  •  隐瞒了意图╮
    2020-12-02 04:25

    Static variables are those variables which are common for all the instances of a class..if one instance changes it.. then value of static variable would be updated for all other instances

提交回复
热议问题