Domanda di colloquio di Garmin

what is singleton class

Risposte di colloquio

Anonimo

8 giu 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

Anonimo

7 mar 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;)); };

Anonimo

10 apr 2010

I dont know...