Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

what is polymorpsim? what are its types?

8 Answers  


What is ambiguity in c++

4 Answers   Accenture, Mphasis,


Write a program to accept a number and to print numbers in pyramid format? for eg:for a no. 5 1 212 32123 4321234 543212345

7 Answers  


where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?

2 Answers   Infosys, Microsoft,


What is multidimensional array?

1 Answers  






What are constructors in oop?

0 Answers  


Is enum a class?

0 Answers  


How Do you Code Composition and Aggregation in C++ ?

3 Answers   IBM, NET,


Write a program to find out the number of palindromes in a sentence.

1 Answers   TCS,


polymorphism means?

6 Answers   BFL,


What is advantage of inheritance?

0 Answers  


Is data hiding and abstraction same?

0 Answers  






Categories