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


Please Help Members By Posting Answers For Below Questions

What is basic concept of oop?

910


can we make game by using c

3735


What is static in oop?

835


How oops is better than procedural?

840


Why is polymorphism used?

787


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4485


What are main features of oop?

879


Are polymorphisms mutations?

900


Plese get me a perfect C++ program for railway/airway reservation with all details.

3675


Why do we use class?

826


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

2377


How long to learn object oriented programming?

823


How can you overcome the diamond problem in inheritance?

970


Get me a number puzzle game-program

1944


Can main method override?

845