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 abstract class in oop?
What is the difference between a constructor and a destructor?
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 static modifier?
What is the difference between encapsulation and polymorphism?
What is the full form of oops?
What is inheritance in oop?
Can bst contain duplicates?
What is polymorphism and types?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
Why do we use polymorphism?
How is polymorphism achieved?
Why do we need polymorphism in c#?
What is the difference between inheritance and polymorphism?
What is encapsulation and abstraction? How are they implemented in C++?