English

Explain in short the three special characteristic of a static data member in a class. - Computer Science 1

Advertisements
Advertisements

Question

Explain in short the three special characteristic of a static data member in a class.

Explain
Advertisements

Solution

The three special characteristics of a static data member in a class are as follows:

  1. It is initialized to zero when the first object of its class is created. No other initialization is permitted.
  2. Only one copy of that member is created for the entire class and is shared by all the objects of that class, no matter how many objects are created.
  3. It is visible only within the class, but its lifetime is the entire program.
shaalaa.com
  Is there an error in this question or solution?
2016-2017 (March)
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×