What is polymorphism ? Explain with examples

Answer Posted / selvi

Polymorphism means one in many forms.It describes a method
in different characteristics. A method gets differentiated
by its Function signature. Function signatures are
datatypes, Number of parameters used in method. For
example, a method called Calculation has different
character such as add, sub, mul, div, etc.

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is constructor overloading in oop?

607


What is balance factor?

589


What is the difference between encapsulation and polymorphism?

598


What is multilevel inheritance?

727


What are the three main types of variables?

603






#include #include #include #include void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

3257


What is abstraction encapsulation?

663


What is encapsulation selenium?

555


Describe these concepts: Polymorphism, Inheritance and Abstraction.

616


What is meant by multiple inheritance?

742


write a programe to calculate the simple intrest and compund intrest using by function overlading

1670


How to call a non virtual function in the derived class by using base class pointer

5281


What are benefits of oop?

641


Templates mean

1592


Can we create object of abstract class?

581