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
What is encapsulation and abstraction? How are they implemented in C++?
What is abstraction with example?
what type of question are asked in thoughtworks pair programming round ?
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
What are the data types in oop?
program for insertion ,deletion,sorting in double link list
Can private class be inherited?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What is pure oop?
What is polymorphism give a real life example?
Why is destructor used?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
when to use 'mutable' keyword and when to use 'const cast' in c++
Get me an image implementation program.
Why is encapsulation used?