a) What is the role of virtual function in polymorphism? Givean example to example to explain it. ) Give at least two advantages and disadvantages ofpolymorphism Q. c) Give the basic difference between simple inheritance andmultiple inheritance. What are the complexity problems in multipleinheritance? Give a brief description about these. a) What is the role of virtual function in polymorphism? Givean example to example to explain it. ) Give at least two advantages and disadvantages ofpolymorphism Q. c) Give the basic difference between simple inheritance andmultiple inheritance. What are the complexity problems in multipleinheritance? Give a brief description about these. ) Give at least two advantages and disadvantages ofpolymorphism Q. c) Give the basic difference between simple inheritance andmultiple inheritance. What are the complexity problems in multipleinheritance? Give a brief description about these.
Explanation / Answer
b) advantages of polymorphism i) less coding ii) object relation (logic) is easy to impliment disadvantages:- i) Implemintaion become difficult ii) error chances doubles when dealing with multipleinheritance. c) In a simple inharritanc one class is inherited only oneparent class, on the other hand in mulitple inheritance one classinheritted from more than one class.