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:
- 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”.
- 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
- Identity: Amar
- Properties: Color, Height, Weight, Age, Qualification…
- Functionalities: walk () , see() , run() , teach(), swim() , drive()….
Object type : Laptop
- Identity: Lenovo
- Properties: Color, Model , Price , Configuration..
- Functionalities: calculate () , play() , store() , send()….