What is polymorphism? Explain with an example.

Answer Posted / swathi

It is a feature that allows one interface to be used for
general class of actions. The specific action is determined
by the exact nature of the situation. In general
polymorphism means "one interface, multiple methods", This
means that it is possible to design a generic interface to
a group of related activities. This helps reduce complexity
by allowing the same interface to be used to specify a
general class of action. It is the compiler's job to select
the specific action (that is, method) as it applies to each
situation

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does oop mean in snapchat?

688


What are properties in oop?

611


What is polymorphism in oops with example?

533


what's the basic's in dot net

1740


How long to learn object oriented programming?

566






What is object in oop?

683


How do you use inheritance in unity?

595


What is multilevel inheritance in oop?

557


What is encapsulation example?

551


What is persistence in oop?

675


What is the main purpose of inheritance law?

673


What is the difference between a constructor and a destructor?

617


Why multiple inheritance is not possible?

602


#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


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

1630