Object
An Object is an identifiable entity with some characteristics and behavior. An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is instantiated (i.e. an object is created) memory is allocated.
Example:
class student
{
private:
int roll;
char name[20];
float age;
public:
void read();
void show();
};
* The above defined class cannot be directly used while programming.
* We have to declare objects of type defined class and then use them while programming.
Student s1,s2,s3;
* Object take up space in memory and have an associated address like a arrays or structure or union in C.
* When a program is executed the objects interact by sending messages to one another.
* Each object contains data and code to manipulate the data.
* Objects can interact without having to know details of each other’s data or code, it is sufficient to know the type of message accepted and type of response returned by the objects.