What is object, characteristics and its example in java
Object
Any entity that has state and behaviour 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 Behaviour.
1. State: State is a well-defined condition of an
item. A state captures the relevant aspects of an object
2. Behaviour: Behaviour is the observable effects
of an operation or event,
Example:-
Object: – Car
State: Colour, Make
Behaviour: Climb Uphill, Accelerate, Slowdown etc.
Characteristics of Objects:
1. Abstraction
2. Encapsulation
3. Message passing
Post a Comment