C++
Programming and Technical
Programming
Variables
Which one of the following is true about the static keyword :-
[1] variable declared as static is shared by all
the objects of the class.
[2] variable declared as static is not shared
by all the objects of the class.
[3] It can't be used as data member of class.
[4] None
.
Read Solution (Total 4)
-
- option [1] , since a static variable is shared by all objects for the class being declared for, for example
- 5 years agoHelpfull: Yes(1) No(0)
- Option 1. Is correct.
Variable declared as static is shared by all the objects of class because only one instance of that static variable which will be shared by all objects. - 8 years agoHelpfull: Yes(0) No(0)
- 1st one is correct
all object of a class share static variable - 8 years agoHelpfull: Yes(0) No(0)
- 1] variable declared as static is shared by all
the objects of the class. - 6 years agoHelpfull: Yes(0) No(0)
C++ Other Question