What is Polymorphism?

Polymorphism means many forms. A single object can refer to the super-class or sub-class depending on the reference type which is called polymorphism. Example: Public class Manipulation(){ //Super class public…

What is Encapsulation?

Purpose of Encapsulation: Protects the code from others. Code maintainability. Example: We are declaring ‘a’ as an integer variable and it should not be negative. public class Addition(){int a =…