cracking singleton with other ways

后端 未结 6 729
情深已故
情深已故 2020-12-07 05:20

I was doing research on singleton and I have developed a very basic singleton class..

public class SingletonObject {
    private static SingletonObject ref;
         


        
6条回答
  •  感动是毒
    2020-12-07 05:54

    If you have two classloaders, you'll be able to create a singleton from each classloader.

    The document "When is a singleton not a singleton" is also worth a read.

提交回复
热议问题