Object Oriented Programming in Java  | Free Java Tutorials

This Free Java Tutorials “Object Oriented Programming in Java” page is giving introduction to Object oriented programming and features of Object orientation.


 

Object Oriented Programming:

  • Java is Object oriented programming language.

 

Is java fully Object Oriented Programming Language?

  • No. Java supporting primitives and Not supporting all the features of OOPS (multiple inheritance).

 

Object Oriented Programming features:

  1. Encapsulation
  2. Abstraction
  3. Inheritance
  4. Polymorphism

 

  • OOP features neither belongs to java nor to any programming language.
  • Every language can adopt OOP features to become Object Oriented Language.
  • Implementation of OOP functionalities in java only through “class” and “Object”.

 

Object:

  • A real world entity (physical substance) having 3 things
    Identity / Name.
    State / Properties / Variables / Data / Data members / Fields
    Behavior / Functionality / Methods / Member Functions / Code

 

Identity: Every Object should be referred by unique Identity in the application.Identity: Every Object should be referred by unique Identity in the application.

State: Every Object should have properties called state of Object. Properties(variables) describe the object. It can be modified only by Behavior of Object.

Behavior: Functionality(methods) of Object is called Behavior. Only Behavior can change state of Object.

Object type : Human

  1. Identity: Amar
  2. Properties: Color, Height, Weight, Age, Qualification…
  3. Functionalities: walk () , see() , run() , teach(), swim() , drive()….

 

Object type : Laptop

  1. Identity: Lenovo
  2. Properties: Color, Model , Price , Configuration..
  3. Functionalities: calculate () , play() , store() , send()….
Share this