cpp:acccess_modifiers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cpp:acccess_modifiers [2021/05/07 04:24] – [Παράδειγμα χρήσης προσδιοριστών πρόσβασης] gthanos | cpp:acccess_modifiers [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 24: | Line 24: | ||
protected: | protected: | ||
int color; | int color; | ||
+ | public: | ||
+ | int borderWidth; | ||
public: | public: | ||
Cuboid(int w, int h, int l); | Cuboid(int w, int h, int l); | ||
Line 78: | Line 80: | ||
Cuboid cuboid(1, | Cuboid cuboid(1, | ||
// | // | ||
+ | cuboid.borderWidth = 5; | ||
+ | | ||
Cube cube(1, 0xcccccc); | Cube cube(1, 0xcccccc); | ||
cuboid.setWidth(5); | cuboid.setWidth(5); | ||
Line 88: | Line 92: | ||
- Τα πεδία //width//, //height// και //length// της κλάσης //Cuboid// είναι ορισμένα ως //private// και δεν είναι ορατά από τη συνάρτηση //main// ή την κλάση // | - Τα πεδία //width//, //height// και //length// της κλάσης //Cuboid// είναι ορισμένα ως //private// και δεν είναι ορατά από τη συνάρτηση //main// ή την κλάση // | ||
- Το πεδίο //color// είναι ορισμένο ως // | - Το πεδίο //color// είναι ορισμένο ως // | ||
- | - Η μέθοδος // | + | - Η μέθοδος // |
</ | </ | ||
cpp/acccess_modifiers.1620361457.txt.gz · Last modified: 2021/05/07 03:24 (external edit)