Live example for static function?

Answer Posted / sachinmundhra

Live Example for static function is Singleton class.

Static Method is used and called to get the instance of
class.

class Base
(
private:
Base()
public:
static Base* GetObject() // This is a static method
};

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe protected access specifiers?

775


What is the use of class in c++?

666


Can a program run without main function?

741


What is long in c++?

837


What is the error in the code below and how should it be corrected?

392






Is c++ an integer?

673


what is c++

1882


Can a class be static in c++?

675


Why is polymorphism useful?

671


What are static and dynamic type checking?

704


What does h mean in maths?

670


What is the basic of c++?

706


What are formatting flags in ios class?

702


What is an adjust field format flag?

765


What are smart pointers?

778