Chapter 11 Flashcards

1
Q

In which order data members initialize

A

Data members initializes in the order in which they are declared.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Does local static variable initialize only one

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is static data member/class variable

A

A variable that is part of a class, yet is not part of an object of that class, is called static data member.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between class variable and instance variable

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Does private static member can not be accessed outside the class except for initialization

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly