OOP in Java
- OOP stands for Object Oriented Programming.
Java is OOP base language.
OOP is basically a technique of writing programs on the basis of objects.
OOP in Java is use to analyze and design the applications in term of objects.
OOP is based on real world modeling.
Programming languages that use classes and objects are also known as object oriented programming language.
The languages which do not support the concept of classes and objects, known as process-oriented programming language.
- Keep in mind that: Object Oriented Programming languages and Object Based Programming languages are not the same.
Advantages of OOP in Java
Easy to Maintain
An object oriented base program is very easy to modify and maintain as compare to a program which is not object oriented.
In OOP, programmer can use the code of existing program to create new program with the help of inheritance.
With encapsulation, hiding of data is possible in OOP. The main purpose of encapsulation is to hide internal object details.
It is an ability of an object to behave in multiple ways.
Basic OOP Concepts
Class is a generic concept in programming languages.
A class can be defined to describe the behavior of the template / blue print / type indicated its support of the object.
It is an entity that has state and behavior.
For example: cats have state - colors, name, reproduction and behavior, eating. Objects are instances of classes.