OOps Concept in Java
Posted By Manish Kumar | 29-Sep-2017
OOPS (Object Oriented programming) is a conceptual programming strategy that is associated with the Classes and Objects and in that various other concepts are used like Inheritance, Polymorphism, Abstraction, Encapsulation etc.
Briefing this concept for a basic knowledge is as below:
1) Abstraction: Abstraction is the strategy in which a developer performs the action with the help of subclasses but do not shows the internal actions, this strategy has only declaration part but implementation part is missing.
2) Encapsulation: Encapsulation is a technique, by using which developers performs the abstraction and for doing this, Java provides some access modifiers which helps the user to bound the elements in different scopes and those modifiers are Private, Public, Package, and Default.
Where Private, Public and Package are used as keywords and for default is already taken as by-default
Polymorphism: If a user/developer need an object to be behaving differently at different times so he/she uses java technique polymorphism, which means one name but different forms.
Also, it is divided into two parts: 1) Compile time polymorphism and 2)
1) Compile time polymorphism is achieved by using method overloading concept and user just need to change the arguments and the method name is same.
Due to this,
Inheritance: This OOPs technique in
In this, we use "extends" keyword followed by parent class name.
Other OOP's concepts are Association, Aggregation, and composition.