what is a virtual class?
Answer Posted / ramakrishna
It is used to avoid the ambiguity problem in c++ (multiple
inheritance).
when sub class inherits same members from 2 base classes.
compiler dont know which variable has assigned the value.
If u declare the class as virtual only one time is
inherited in its derived class.A copy will never get
inherited.
concept of virtual methods is different purpose.
like how we have abstract key word in java,we can acheive
method abstraction using virtual keyword before a method.
please select no if u really know this answer is wrong.
people with out having knowlede saying simple know hurts
the technical world.
Regards,
Ramakrishna Yechuri
sr corporate Trainer
yrk_in@yahoo.com
Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What are the two different types of polymorphism?
Can destructor be overloaded?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What is encapsulation with example?
Is react oop?
What do you mean by overloading?
What does it mean when someone says I oop?
What are the 3 pillars of oop?
What is a class oop?
What is balance factor?
What is meant by multiple inheritance?
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?
What is an advantage of polymorphism?
What is cohesion in oop?
What is oops?what is its use in software engineering?