C++ Programming :: OOPS Concepts - Discussion
9 / 14
Static data members
Ashould be initialized like global variables.
Bhas only one copy of it exists for all instances of a class.
Cshould be initialized like extern variables.
Dboth (a) and (b)
Show Explanation
Static members are shared across all instances of a Class which means a static member will only have one copy of it exists for all instances of a class.
Asked In ::
Static members can only be declared inside class and need to be defined outside the class using scope resolution operator. If we try to access a static member without defining it explicitly, program throws compilation error.
Static members are shared across all instances of a Class which means a static member will only have one copy of it exists for all instances of a class.
Read Full Answer
Report Error
Please Login First Click Here