What is virtual class and friend class?

Answers were Sorted based on User's Feedback



What is virtual class and friend class?..

Answer / kirti joshi

friend class is used to share private data between 2 or
more classes the function declared as freind are not called
using any object it is called like normal .the arguments to
such functions is normally object of a class.
virtual class is used for run time polymorphism when object
is linked to procedure call at run time

Is This Answer Correct ?    53 Yes 7 No

What is virtual class and friend class?..

Answer / 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

What is virtual class and friend class?..

Answer / vaibhav panchal

A virtual class is an inner class that can be overridden by
derived classes of the outer class.

Is This Answer Correct ?    27 Yes 7 No

What is virtual class and friend class?..

Answer / guest

frien class are used when two or more classes are designed
to work together and virtual base class aids in multiple
inheritance

Is This Answer Correct ?    33 Yes 17 No

What is virtual class and friend class?..

Answer / govind

A virtual class is an inner class that can be overridden by
derived classes of the outer class.buti in this virtual
class cant access the privat member data and funtion .

A friend class is can access the privat member data and
function .

Is This Answer Correct ?    14 Yes 3 No

Post New Answer

More OOPS Interview Questions

1. Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)

1 Answers   Nagarro,


OOP'S advantages of inheritance include:

1 Answers   Infosys,


Can we override main method?

0 Answers  


Write A Program using Single and Multiple Inheritance.

1 Answers  


What is polymorphism give a real life example?

0 Answers  






What are the important components of cohesion?

0 Answers  


what is the difference between <stdio.h>and "stdio.h"?

5 Answers  


In OverLoading concept,Why they are not consider return value and why they are consider only parameters in method? For ex: public int Add(int a,int b){...} public String Add(int a,int b){...}

1 Answers  


when my application exe is running nad i don't want to create another exe what should i do

2 Answers   HCL,


What are the benefits of oop?

0 Answers  


Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers from user and swap it without using a temp variable?

2 Answers   NIIT,


define a string class. overload the operator == to compare two strings

2 Answers   Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,


Categories