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
Why is static class not inherited?
what is different between oops and c++
Why is there no multiple inheritance?
Why do we use inheritance?
What is use of overloading?
Can we define a class within the interface?
What does it mean when someone says I oop?
What is oops concept with example?
Why is polymorphism needed?
Why do we use encapsulation in oops?
What is abstraction example?
What is abstraction in oops?
What are the data types in oop?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
what type of questions