Object oriented programming


#1

can you please explain me, what does attribute mean, and what is instance?


#2

lets do instance first, a class is a description of something (sort of like a blue print), then the instance is the actual result of this blueprint

so for example we can have a blueprint of a house (this describes the house, materials used, dimmensions and so on) the instance is then an actual house (like the one you live in, and your neighbors)

attributes can refer to anything we just mentions (materials, dimmensions and so on) in technical terms, it can be a class/member variable, an instance variable or a method.

so anything where you have instance.method() or instance.classVariable or instance.instanceVariable

you use .sort() before, its a attribute (method to be specific) of list


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.