質問するログイン新規登録

回答編集履歴

2

説明修正

2022/08/26 04:55

投稿

Matsumon0104
Matsumon0104

スコア1005

answer CHANGED
@@ -1,4 +1,6 @@
1
1
  Gooクラスのインスタンスのメソッドを使用しているので、この「getMsg」は「GooクラスのgetMsg」です。
2
+ そして、「GooクラスのgetMsg」で取得した「Gooクラスのmsg」を「BooクラスのsetMsg」で「Booクラスのmsg」に設定しています。
3
+ ですので、「GooクラスのgetMsg」も「BooクラスのgetMsg」(下記ソース部分でGooクラスのmsgの値を入れてるから)も同じ値になっています。
2
4
 
3
5
  ```java
4
6
  public Goo useGoo(Goo g) {

1

文言修正

2022/08/26 04:51

投稿

Matsumon0104
Matsumon0104

スコア1005

answer CHANGED
@@ -1,4 +1,4 @@
1
- Gooクラスのインスタンスメソッドを使用しているので、この「getMsg」は「GooクラスのgetMsg」です。
1
+ Gooクラスのインスタンスメソッドを使用しているので、この「getMsg」は「GooクラスのgetMsg」です。
2
2
 
3
3
  ```java
4
4
  public Goo useGoo(Goo g) {