473,382 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Access control + overloading + overriding

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
1 1594

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris... | last post by:
Two simple questions regarding future of Python: 1) Is there already a "fix" to avoid writing to an attribute that isn't defined yet? I remember this being an often discussed problem, but...
1
by: Xiangliang Meng | last post by:
Hi, all. When reading C++ books, I'm alway confused by those terms "redefining functions", "overloading functions" and "overriding functions". Please give me some comments on those terms....
11
by: iceColdFire | last post by:
Hi, What is the Diff btwn Function overloading and overriding thanks, a.a.cpp
15
by: Susan Baker | last post by:
Hello everybody, I'm new to C++ (I have some C background). I've read up on this topic a few times but it just dosen't seem to be sinking in. 1. Whats the difference between overloading and...
45
by: JaSeong Ju | last post by:
I would like to overload a C function. Is there any easy way to do this?
5
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a...
14
by: ApexData | last post by:
I am considering building some distributable commercial applications. For about a year now, I have been using Access2000. This was my first venture into object oriented database development. ...
8
by: yashwant pinge | last post by:
#include<iostream> using namespace std; class base { public: void display() { } };
20
by: ramadeviirrigireddy | last post by:
Can anyone tell me whether the return type of the method will also be considered when you are overriding a method? what i mean exactly is whether the return type can be different when you are...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.