English

Differentiate between static data members and non-static data members. - Computer Applications

Advertisements
Advertisements

Question

Differentiate between static data members and non-static data members. 

Distinguish Between

Solution

S. No. Static data member Non-static/Ordinary data member
1. All class objects share a single copy of this variable. Each item creates a copy of the data.
2. It can be accessed without requiring an instance of the class. Using it requires first constructing a class instance.
3. Static variables are allocated only once during class loading. Each new object creates additional memory allocations for these variables.
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Class as the Basis of all Computation (Objects and Classes) - EXERCISES [Page 384]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 6 Class as the Basis of all Computation (Objects and Classes)
EXERCISES | Q V. 5. | Page 384
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×