Garmin interview question

what is singleton class

Interview Answers

Anonymous

Jun 8, 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

Anonymous

Mar 7, 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;)); };

Anonymous

Apr 10, 2010

I dont know...