Chapter 11 Flashcards
In which order data members initialize
Data members initializes in the order in which they are declared.
Does local static variable initialize only one
Yes
What is static data member/class variable
A variable that is part of a class, yet is not part of an object of that class, is called static data member.
What is the difference between class variable and instance variable
Class variables only have one copy that is shared by all the different objects of a class, whereas every object has it’s own personal copy of an instance variable. So, instance variables across different objects can have different values whereas class variables across different objects can have only one value.
Does private static member can not be accessed outside the class except for initialization
Yes