Object in Java


(Lakshmi Prasanna) #1

In Java, an entity that has states and behaviors are known as Objects.

  • For example, a cat has states such as color, name, etc. and behaviors such as Stretching, Yawning, Eating, etc.
  • Dog, Cat, Chair, Car, are all few examples of an Object.
  • An object may also have an Identity which implemented by a unique ID.
  • Also, an Object is an instance of a Class in Java.