What Is an Object?
Answer:
We are going to introduce the concept object in the context of OOP. Software objects model real world objects or abstract concepts (which are also regarded as objects).
Examples of real-world objects are people, cars, goods, purchases, etc. abstract objects are concepts in an object area, which we have to model and use in a computer program. Examples of abstract objects are the data structures stack, queue, list and tree. They are not going to be a subject in this chapter, but we are going to see them in details in the next chapters.
In objects from the real world (as well as in the abstract objects) we can distinguish the following two groups of their characteristics:
- States – these are the characteristics of the object which define it in a way and describe it in general or in a specific moment
- Behavior – these are the specific distinctive actions, which can be done by the object.
Let’s take for example an object from the real world – "dog". The states of the dog can be "name", "fur color" and "breed", and its behavior – "barking", "sitting" and "walking".
Objects in OOP combine data and the means for their processing in one. They correspond to objects in real world and contain data and actions:
- Data members – embedded in objects variables, which describe their states.
- Methods – we have already considered them in details. They are a tool for building the objects.
Examples of real-world objects are people, cars, goods, purchases, etc. abstract objects are concepts in an object area, which we have to model and use in a computer program. Examples of abstract objects are the data structures stack, queue, list and tree. They are not going to be a subject in this chapter, but we are going to see them in details in the next chapters.
In objects from the real world (as well as in the abstract objects) we can distinguish the following two groups of their characteristics:
- States – these are the characteristics of the object which define it in a way and describe it in general or in a specific moment
- Behavior – these are the specific distinctive actions, which can be done by the object.
Let’s take for example an object from the real world – "dog". The states of the dog can be "name", "fur color" and "breed", and its behavior – "barking", "sitting" and "walking".
Objects in OOP combine data and the means for their processing in one. They correspond to objects in real world and contain data and actions:
- Data members – embedded in objects variables, which describe their states.
- Methods – we have already considered them in details. They are a tool for building the objects.
No comments:
Post a Comment