Object

It is a basic unit of Object-Oriented Programming and represents the real life entities. A typical Java program creates many objects, which as you know, interact by invoking methods. An object consists of :

  1. State: It is represented by attributes of an object. It also reflects the properties of an object.
  2. Behavior: It is represented by methods of an object. It also reflects the response of an object with other objects.
  3. Identity: It gives a unique name to an object and enables one object to interact with other objects.

Example of an object can be dog. Objects correspond to things found in the real world. For example, a graphics program may have objects such as circle, square, menu. An online shopping system might have objects such as shopping cart, customer, and product.