What are the different forms of polymorphism??

Answer Posted / amit

1.Compile time polymorphism
Exhibited by: Function overloading
Operator overloading
2.Run time polymorphism
Exhibited by: Function overriding

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#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.

3253


Why we use classes in oop?

583


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1147


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1395


How is class defined?

588






What is an advantage of polymorphism?

597


What exactly is polymorphism?

610


What is abstraction and encapsulation?

575


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6153


what type of questions

1697


How to use CMutex, CSemaphore in VC++ MFC

4333


How long to learn object oriented programming?

565


Why it is called runtime polymorphism?

577


What are two types of polymorphism?

611


What is the diamond problem in inheritance?

579