What is the exact meaning of static fields in Java?

后端 未结 4 1066
迷失自我
迷失自我 2020-11-22 14:16

I would like to share an object between various instances of objects of the same class.

Conceptually, while my program is running, all the objects of class A access

4条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 14:52

    What you are looking for is called the Singleton Pattern.

提交回复
热议问题