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 is difference between class template and template class?
What is balance factor?
What is protected in oop?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
What is the difference between abstraction and polymorphism?
How to call a non virtual function in the derived class by using base class pointer
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is interface in oop?
What is abstraction in oop with example?
What does sksksk mean in text slang?
What is an advantage of polymorphism?
Why multiple inheritance is not allowed?
How Do you Code Composition and Aggregation in C++ ?
write a C++ program for booking using constructor and destructor.
What is persistence in oop?