回答編集履歴

2

クラス名の修正

2018/07/08 06:05

投稿

yukapome789
yukapome789

スコア361

test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ```
8
8
 
9
- public class MathFunctionBean{
9
+ public class Math2xFunctionBean{
10
10
 
11
11
  private int x;
12
12
 

1

コードの修正

2018/07/08 06:05

投稿

yukapome789
yukapome789

スコア361

test CHANGED
@@ -10,11 +10,27 @@
10
10
 
11
11
  private int x;
12
12
 
13
- private int y;
14
13
 
15
-
16
14
 
17
- //セッターゲッターは省略
15
+ public void setX(int x){
16
+
17
+ this.x = x;
18
+
19
+ }
20
+
21
+ public int getX(){
22
+
23
+ return this.x;
24
+
25
+ }
26
+
27
+ public int getY(){
28
+
29
+ return 2*this.x;
30
+
31
+ }
32
+
33
+
18
34
 
19
35
  }
20
36