Open In App

What are Objects in Programming?

Last Updated : 31 Jul, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In object-oriented programming (OOP), objects are the basic entities that actually exists in the memory. Each object is based on a blueprint of attributes and behaviours (variables and functions) defined as Class.

The basic purpose of a Class is to identify the common attributes and behaviours and group them as an entity that can be reused again and again for similar purposes. The Objects are such entities that are created based on these classes to follow that purpose. All data members and member functions of the class can be accessed with the help of objects. When a class is defined, no memory is allocated, but memory is allocated when it is instantiated (i.e. an object is created).

Example of Object

For Example, the objects for the class Account are SBI Account, ICICI account, etc.

Characteristics of an object

As discussed above, every object has some attributes and behaviours, but it is very important to understand what are the characteristics, that every object must have:

  1. Identity: Every object must have a different identity from the other, known as the object’s name. No two object must have the same name.
  2. State: If there are some properties of a class, that is designed to be derived in an object, it must have some values to get initiated (usually done with the help of constructors).
  3. Behaviour: Now since the object have a name and some properties, it must have some purpose as well. So these purposes are defined with help of functions (processes) and are known as behaviours.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads