React.js
Angular
Ethical Hacking
Agile
AWS
BlockChain
Cassandra
Cloud
Salesforce
Scaled Agile
TOGAF
DevOps
GIT
Jenkins
Jira
Kibana
Linux
NGINX
Ansible
Artificial Intelligence
in JAVA by
What is Polymorphism?

Polymorphism means many forms.

A single object can refer the super class or sub-class depending on the reference type which is called polymorphism.

Example:

1

Public class Manipulation(){ //Super class

2

public void add(){

3

}

4

}

5

public class Addition extends Manipulation(){ // Sub class

6

public void add(){

7

}

8

public static void main(String args[]){

9

Manipulation addition = new Addition();//Manipulation is reference type and Addition is reference type

10

addition.add();

11

}

12

}

Using Manipulation reference type we can call the Addition class “add()” method. This ability is known as Polymorphism.

Polymorphism is applicable for overriding and not for overloading.
Click here to read more about DevOps

Related questions

Madanswer
0 votes
asked May 24, 2019 in JAVA by rajeshsharma
0 votes
asked May 24, 2019 in JAVA by rajeshsharma
...