Frage im Vorstellungsgespräch bei Garmin

what is singleton class

Antworten zu Vorstellungsgespräch

Anonym

8. Juni 2010

A class whose number of instances that can be instantiated is limited to one is called a singleton class. Thus, at any given time only one instance can exist, no more. for more info, check http://www.codeguru.com/forum/showthread.php?t=344782

1

Anonym

7. März 2012

A class where the constructor is private. class myclass; myclass *myclass:: _instance = NULL; class myclass { private: myclass(); public: static myclass *_instance; myclass *instance() { if (_instance) return _instance; else return ((_instance = new myclass;)); };

Anonym

10. Apr. 2010

I dont know...