design patterns - Multiple instances of Singleton class. Possible? -
i found this explanatory link states
ensure class has 1 instance, , provide global point of access it.
i appeared @ interview , surprise asked me too can singleton class have multiples instances, technology being java , objective c. answer question no believe right singleton variable being global shall check if null
or not. , null
first time.
out of curiosity confirming it. can provide confirmation explanation weather right or wrong.
the word singleton definition(of design patterns) not allows multiple instances, yeah can tweak class create multiple instances won't considered singleton definition
Comments
Post a Comment