You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/solutions/oop/inheritance.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,17 @@ tags:
16
16
- [ ] `over`
17
17
- [ ] `inherits`
18
18
19
+
#. Inheritance is …
20
+
21
+
- [x] … a way of implementing a class by re-using another class' code.
22
+
- [ ] … impossible to represent in a UML diagram.
23
+
- [ ] … achieved using the `;` (semicolon) symbol.
24
+
- [ ] … a way of connecting a *basic* class with a *derived* class.
25
+
26
+
<details><summary>Comment</summary>
27
+
The class inherited from is called the *base*, superclass or parent class, but not *basic*.
28
+
</details>
29
+
19
30
#. Suppose your are given an `ElectricDevice` class and a `WallDecor` class. You would like to write a `Clock` class that represents at the same time an electric device and a wall decor. This is possible only if the `ElectricDevice` and `WallDecor` classes are…
20
31
21
32
- [ ] Sealed
@@ -38,6 +49,26 @@ tags:
38
49
39
50
## Problems
40
51
52
+
#. Assume given the following class implementation:
0 commit comments