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


Please Help Members By Posting Answers For Below Questions

What is inheritance in simple words?

627


What is inheritance and how many types of inheritance?

622


How do you explain polymorphism?

596


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2170


What is the benefit of oop?

570






Can main method override?

587


Why is object oriented programming so hard?

616


Why is oop useful?

602


Why do we use class in oops?

555


What do you mean by overloading?

584


Can enum be null?

587


Write a c++ program to display pass and fail for three student using static member function

2818


class type to basic type conversion

1841


What is encapsulation process?

584


Explain the concepts involved in Object Oriented programming.

642