Which of the following type of data member can be shared by all instances of its class?
A.Public
B.Inherited
C.Static
D.Friend
Answers
Answered by
0
a. static
..............
..............
Answered by
0
The correct answer is OPTION C: Static. Static data members can be shared by all of its classes.
- Static data members are members of a class that has the static keyword expressed.
- A static member's properties are one-of-a-kind. The following are some of them:
- Regardless of how many objects are created, only one copy of that member is created for the entire class and shared by everyone.
- It's set up before any of the objects in this class are created, even before the main begins.
- It is only visible within the class, but it lasts the entire programme.
Similar questions