You have one base class virtual function how will call that
function from derived class?

Answers were Sorted based on User's Feedback



You have one base class virtual function how will call that function from derived class?..

Answer / kalaivani

u can call the base class virtual fn,if it is declare as
public

Is This Answer Correct ?    4 Yes 0 No

You have one base class virtual function how will call that function from derived class?..

Answer / narendra

class A
{
public:
virtual void fun()
{
cout<<"class A\n";
}
};
class B:public A
{
public:
virtual void fun()
{
cout<<"class B\n";
A::fun(); //calling base class virtual function.
}
};

Is This Answer Correct ?    4 Yes 2 No

You have one base class virtual function how will call that function from derived class?..

Answer / swetcha

class a
{
public virtual int m()
{
return 1;
}
}
class b:a
{
public int j()
{
return m();
}
}

Is This Answer Correct ?    4 Yes 4 No

You have one base class virtual function how will call that function from derived class?..

Answer / mazher

class B:A
{
public override void A_Func()
{
base.A_Func();
}
}

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More OOPS Interview Questions

How do you define social class?

0 Answers  


What is Iteration Hierarchy? What is what is Object behavioral concept?

1 Answers  


What is an interface in oop?

0 Answers  


what is the use of classes in c++;

2 Answers   HCL,


What is the important feature of inheritance?

0 Answers   BPL,






What makes a language oop?

0 Answers  


When you define a integer it gets stored in which data structure?(Stack or a heap)

2 Answers   emc2,


What are the benefits of polymorphism?

0 Answers  


swapping program does not use third variable

5 Answers   TCS,


What is constructor in oop?

0 Answers  


Difference between vector and array

2 Answers  


why we are declare the function in the abstract class even though we are declaring it in Derived class?

1 Answers   TCS,


Categories