What is polymorphism? Explain with an example.

Answer Posted / santosh

Polymorphism is one of the important feature of OOP's. It
consist of 2 words i.e., 'Poly' which stands for many
and 'Morphism' stands for forms.

We can divide the polymorphism into 2 types.
1. Static polymorphism
2. Dynamic polymorphism

Static polymorphism:- In this the binding is taken place in
compile time. The different types of static polymorphism
are:-
a) Function Overloading
b) Operator Overloading

Dynamic polymorphism:- In this the binding that takes place
at run-time. The difference types of dynamic polymorphism
are:-
a) Virtual function
b) Abstract class

Is This Answer Correct ?    272 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is object in oop?

679


What is a class oop?

592


Whats oop mean?

588


What is meant by multiple inheritance?

736


What is abstraction example?

616






What causes polymorphism?

569


What is difference between oop and pop?

611


Why multiple inheritance is not allowed?

581


What is a superclass in oop?

665


Can abstract class have normal methods?

610


Where You Can Use Interface in your Project

1423


What is the difference between static polymorphism and dynamic polymorphism?

579


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

1635


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1652


What is encapsulation with example?

576