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

前端 未结 19 2207
灰色年华
灰色年华 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:39

    ThreadLocal variables are typically implemented as private static. In this way, they are not bound to the class and each thread has its own reference to its own "ThreadLocal" object.

提交回复
热议问题