我需要一个单例类来实例化一些参数。我现在的做法是:classSingletonExample{privateSingletonExamplemInstance;//othermembers...privateSingletonExample(){}publicSingletonExampleInstance{get{if(mInstance==null){thrownewException("Objectnotcreated");}returnmInstance;}}publicvoidCreate(stringarg1,stringarg2){mInstance=newSinglet
我需要一个单例类来实例化一些参数。我现在的做法是:classSingletonExample{privateSingletonExamplemInstance;//othermembers...privateSingletonExample(){}publicSingletonExampleInstance{get{if(mInstance==null){thrownewException("Objectnotcreated");}returnmInstance;}}publicvoidCreate(stringarg1,stringarg2){mInstance=newSinglet