@Question:
Yes, it does. Why wouldn't it? bcd inherits abc and doesn't overload display().
Lines 5, 6, and 10:
Naw, you don't need to have the access specifiers in the same line as each declaration, like in Java. This is perfectly valid:
1 2 3 4 5 6 7 8 9 10 11 12
|
class abc
{
private:
int a;
public:
abc() {
a=7;
}
void display() {
cout<<a;
}
};
|
EDIT: -Albatross
Last edited on
You mean, if in case a derived function is not overridden, base class function will be called always?
Yes. That's what inheritance is!