How to hide the base class functionality in Inheritance?



How to hide the base class functionality in Inheritance?..

Answer / Gaurav Shukla

In C++, a derived class can hide a base class member by providing its own implementation of the member with the same name. This is known as method hiding or overriding.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

//what is wrong with the programme?? #include<iostream.h> template <class first> class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<<i; } void main() { dd <char>g; g.set(); g.print(); }

1 Answers  


What is the difference between an object and a class?

3 Answers  


What is the different between Applet and Application?

2 Answers  


Does c++ support multilevel and multiple inheritance?

9 Answers   IBS, Wipro,


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,


#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; a.x = 22; int c = a.x; int *b = new int; cout << c; return 0; } option: No output 0 22 -(11) Will not compile

1 Answers   CTS, Wipro,


What do you mean by public, private, protected and friendly?

3 Answers   CA,


What polymorphism means?

1 Answers  


3. Differentiate verification and validation.

1 Answers  


write a program to find 2 power of a 5digit number with out using big int and exponent ?

1 Answers  


what is the use of mutable key word

3 Answers   HCL,


What is multiple inheritance ?

17 Answers   Blue Star, C DAC, CDAC, Impetus, Ness Technologies, Softvision Solution,


Categories