Saturday 26 December 2015

What is object, characteristics and its example in java

Object

Any entity that has state and behavior is known as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.

It is a bundle of related variables and functions (also known methods).


Objects share two characteristics: They have State and Behavior.


  1. State: State is a well defined condition of an item. A state captures the relevant aspects of an object
  2. Behavior: Behavior is the observable effects of an operation or event,

Example :

Object: – Car

StateColor, Make

BehaviorClimb Uphill, Accelerate, SlowDown etc







Characteristics of Objects:
  1. Abstraction
  2. Encapsulation
  3. Message passing

No comments:

Post a Comment