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 |
//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(); }
What is the difference between an object and a class?
What is the different between Applet and Application?
Does c++ support multilevel and multiple inheritance?
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 :( :-?
#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
What do you mean by public, private, protected and friendly?
What polymorphism means?
3. Differentiate verification and validation.
write a program to find 2 power of a 5digit number with out using big int and exponent ?
what is the use of mutable key word
What is multiple inheritance ?
17 Answers Blue Star, C DAC, CDAC, Impetus, Ness Technologies, Softvision Solution,