Spaces:
Running
Running
Create 07B. Corresponding methods
Browse files
Week 5: Class hierarchies/07B. Corresponding methods
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Arrange the method definitions in boxes
|
| 2 |
+
according to which method definition they could overwrite in the succeeding class.
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
List 1: Valid calculate Methods - calculate(int first, int second)
|
| 7 |
+
calculate(int a, int b)
|
| 8 |
+
calculate(int num1, int num2)
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
List 2: Valid average Methods - average(double a, int b)
|
| 12 |
+
average(double a, int b)
|
| 13 |
+
average(double first, int second)
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
List 3: Invalid/Non-Matching Methods
|
| 17 |
+
calculate(double n1, double n2)
|
| 18 |
+
calculate(int a, int b, int c)
|
| 19 |
+
calculate(int num1, double num2)
|
| 20 |
+
aveage(int num) [Misspelled/Incorrect parameters]
|
| 21 |
+
average(int a, double b)
|
| 22 |
+
average(int first, double second)
|
| 23 |
+
|