|
-
Katana Wielding Moderator
Originally posted by Klashe:
A private member cannot participate in inheritance. Only protected members can.
Example:
Class X:{
Protected:
Int I;
Int J;
Private:
Int L;
Public:
Void get_ij();
Void put_ij();
};
Class Y : public X {
Int k;
Public:
Int get_k;
Void make K;
};
Here class Y has access to I and J in class X because they are protected. But Y does not have access to L, because it is private to class X.
Oh yeah, and ignore the caps in that last post. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|