InterviewSolution
Saved Bookmarks
| 1. |
What are the static members and static member functions? |
|
Answer» When a VARIABLE in a class is declared static, SPACE for it is ALLOCATED for the lifetime of the program. No matter how many objects of that class have been created, there is only one copy of the static member. So same static member can be accessed by all the objects of that class. A static member function can be called even if no objects of the class exist and the static function are accessed using only the class name and the scope resolution OPERATOR :: |
|