what keyword is used to specify that a data member is a class data member
The keyword used to specify that a data member is a class data member
(i.e., shared by all objects of the class) is static in languages like C++
and Java.
In other words:
- A normal data member → each object gets its own separate copy.
- A
staticdata member → only one shared copy exists for the entire class, regardless of how many objects are created.
So if your exam or textbook question is:
“What keyword is used to specify that a data member is a class data member?”
The expected one-word answer is:
static