What is virtual class and friend class?
Answer Posted / vaibhav panchal
A virtual class is an inner class that can be overridden by
derived classes of the outer class.
eg.
class Base
{
public:
int value
};
class child1 : public Base { };
class child2 : public Base { };
class grandchild : virtual public child1, virtual public
child2
{
public:
grandchild() { value };
};
| Is This Answer Correct ? | 38 Yes | 4 No |
Post New Answer View All Answers
What is polymorphism and its types?
Why do we use encapsulation in oops?
Is data hiding and abstraction same?
How do you achieve polymorphism?
Why do while loop is used?
Can we have inheritance without polymorphism?
What is pointer in oop?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
Why is object oriented programming so hard?
What is and I oop mean?
What is class in oop with example?
What is oops in simple words?
Why multiple inheritance is not possible?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
What is object in oop?