for example A,B,C,D are class all the 4 class contain one
method who() but the method who() implementaion is differnet
among each class. the relation among the 4 class are
A is base class and is inherited by B and C.and from this
two B and C where D is inherited.
the question is i want to display the output who() method in
all the classes(A,B,C,D)the output of who() method is
diferrent amond all the class(A,B,C,D)
------A------ virtuval who(print a)
override | |
who(print b) B C override who(print c)
| |
-------D------ override who(print d)
Answer Posted / ana
only pure virtual function cant be executed, so A.who() can
be executed
and since you override who() in B, C and D, the output is
different
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why is there no multiple inheritance?
State what is encapsulation and friend function?
What is oops and why we use oops?
What does sksksk mean in text slang?
What is an advantage of polymorphism?
How is polymorphism achieved?
What is this pointer in oop?
What is static in oop?
#include
Write a program to reverse a string using recursive function?
what type of question are asked in thoughtworks pair programming round ?
How does polymorphism work?
What is polymorphism and example?
What are the two different types of polymorphism?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?