By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,170 Members | 1,053 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,170 IT Pros & Developers. It's quick & easy.

Access control + overloading + overriding

P: n/a
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!



Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"BDob" <bd*****@at.att.net> wrote in message
news:GU**********************@bgtnsc05-news.ops.worldnet.att.net...
| 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."

Yes.

| Furthermore, "Base::Method2" is still overloaded in Base class, though two
| of them separated in different access specifiers.
|
| Is the understanding correct?

Yes.

Cheers.
Chris Val
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.