Singleton pattern interview

前端 未结 8 2177
忘了有多久
忘了有多久 2021-02-04 14:26

I am recently asked about java related question in an interview with following code, since I am very new to java and barely code in Java so I really have no idea what the follow

8条回答
  •  迷失自我
    2021-02-04 14:47

    simple answer is 2) A Bolton will never be created because when you create instance the constructor will call inside constructor initialization when call getInstance method then answer will be single instance will be created.

提交回复
热议问题