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 multilevel inheritance?
What is polymorphism give a real life example?
explain sub-type and sub class? atleast u have differ it into 4 points?
Why is static class not inherited?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
What is and I oop mean?
What are classes oop?
What makes a language oop?
to find out the minimum of two integer number of two different classes using friend function
What is abstract class in oop?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
Is abstract thinking intelligence?
What is encapsulation with real life example?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
Advantage and disadvantage of routing in telecom sector