B
BDob
Standard documents "Access control is not considered in determining
overriding."
To further explain what's puzzling me, I put up an example below:
class Base
{
public:
virtual void Method1(int a);
void Method2(int b);
private:
void Method2(char c);
};
class Derived : public Base
{
void Method1(int a)
};
If I understand it correctly, "Derived::Method1" should continue to be
overriding "Base::Method1" though access specifiers are different among Base
and Derived classes for "Method1."
Furthermore, "Base::Method2" is still overloaded in Base class, though two
of them separated in different access specifiers.
Is the understanding correct?
Many thanks!
overriding."
To further explain what's puzzling me, I put up an example below:
class Base
{
public:
virtual void Method1(int a);
void Method2(int b);
private:
void Method2(char c);
};
class Derived : public Base
{
void Method1(int a)
};
If I understand it correctly, "Derived::Method1" should continue to be
overriding "Base::Method1" though access specifiers are different among Base
and Derived classes for "Method1."
Furthermore, "Base::Method2" is still overloaded in Base class, though two
of them separated in different access specifiers.
Is the understanding correct?
Many thanks!