質問編集履歴
1
インターフェースを追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,7 +16,15 @@
|
|
16
16
|
```
|
17
17
|
|
18
18
|
```java
|
19
|
+
public interface Shipping{
|
20
|
+
String info();
|
21
|
+
int shipping();
|
22
|
+
int handling();
|
23
|
+
}
|
24
|
+
```
|
25
|
+
|
26
|
+
```java
|
19
|
-
public class Fruit extends Content{
|
27
|
+
public class Fruit extends Content implements Shipping{
|
20
28
|
private int size;
|
21
29
|
public Fruit(int code, String name, int size){
|
22
30
|
super(code,name);
|
@@ -68,7 +76,7 @@
|
|
68
76
|
```
|
69
77
|
|
70
78
|
```java
|
71
|
-
public class Vegetable extends Content{
|
79
|
+
public class Vegetable extends Content implements Shipping{
|
72
80
|
|
73
81
|
public Vegetable(int code, String name, int size){
|
74
82
|
super(code,name,size);
|