Question

data struc and algo with C++ class.....................(please include resources) What are the advantages and disadvantages of...

data struc and algo with C++ class.....................(please include resources)

What are the advantages and disadvantages of Polymorphism in programming?

Homework Answers

Answer #1

Advantages of Polymorphism - Polymorphism means one task can be performed in many ways

1)Polymorphism leads to  Resusability of code

2)Method Overloading (Polymorphism ) - allows one to write same method same with different argument , so same method can be used to perform different operation

3)Polymorphism allows constructor overloading so different operation can be performed by calling different constructor with different parameters.

4)Polymorphism provides robustness in the application

Disadvantage of polymorphism -

1)Polymorphism (Method overloading) - Function with same name can be overloaded but function with same name and parameters cant be overloaded if their return type is different.

2)At runtime polymorphism creates performance issues , because at runtime their may be lot of virtual function so to decide which function to use or not makes performance issues.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Data struc. and algo. with C++ class........ How is encapsulation used to facilitate programming? Give a...
Data struc. and algo. with C++ class........ How is encapsulation used to facilitate programming? Give a code example and discuss what needs to be done without encapsulation in place (without encapsulation)?
The class Object defines an equal() method to compare objects. Specify the advantages and disadvantages of...
The class Object defines an equal() method to compare objects. Specify the advantages and disadvantages of using this method and suggest an alternative for equality. Illustrate with code examples. (Please elaborate on the advantages and disadvantages; also please include your sources and references) Thanks a lot!
What are the advantages and disadvantages to decentralization? What are the advantages and disadvantages of centralization?...
What are the advantages and disadvantages to decentralization? What are the advantages and disadvantages of centralization? Does one work in one environment better than the other? Please give well thought out responses
What are the advantages and disadvantages of trading options instead of equities? be detailed and include...
What are the advantages and disadvantages of trading options instead of equities? be detailed and include them all.
Part1: What is data mining explain the advantages and disadvantages in detail?
Part1: What is data mining explain the advantages and disadvantages in detail?
What are the advantages and disadvantages of common study strategies (examples include: flashcards, repetition, mnemonic devices).
What are the advantages and disadvantages of common study strategies (examples include: flashcards, repetition, mnemonic devices).
what are the advantages and disadvantages of cumene hydroproxide process? what are the advantages and disadvantages...
what are the advantages and disadvantages of cumene hydroproxide process? what are the advantages and disadvantages of Acetone-Butanol-Ethanol fermentation process (ABE fermentation)?
Please discuss the advantages and disadvantages of placing your classes within a single file or in...
Please discuss the advantages and disadvantages of placing your classes within a single file or in separate files? Also, explain what is an interface and How does an interface differs from an actual class?
what are the advantages and disadvantages of phylogenetic networking? please give a real-life example.
what are the advantages and disadvantages of phylogenetic networking? please give a real-life example.
what are the advantages and disadvantages of using secondary data to answer a business research question?
what are the advantages and disadvantages of using secondary data to answer a business research question?