71.6k views
0 votes
Where are the data components of a class that differ for each object stored?

2 Answers

2 votes

The answer is instance variable. Each object in data components of a class differ and are stored in instance variable. Moreover, when an object is instantiated, it means that for each instantiated object of the class, there is a separate copy or instance.

User KoreanDude
by
6.8k points
2 votes
The answer is Instance Variables. The data components of a class that differ for each object stored is Instance Variables. An instance variable has a name beginning with @ , and its scope is confined to whatever object self refers to.They are called so because their values are instance specific and are not shared among instances.
User PilotInPyjamas
by
6.5k points