saneha
04-29-2011, 08:23 AM
What are Static Data Members?
Vuhelper
04-29-2011, 08:23 AM
A variable that is part of a class, yet is not part of any object of that class, is called static data member. Static data members are shared by all instances of the class. Static data members do not belong to any particular instance of a class. The life time of static data member is equal to the entire life time of class. When a data member is declared as static, only one copy of the data is maintained for all object of the class.
Example:
static int noOfStudents;
Best Regards!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.