回答編集履歴

1

既にあるクラスを最初にインスタンス化

2019/12/24 07:38

投稿

shiracamus
shiracamus

スコア5406

test CHANGED
@@ -23,6 +23,8 @@
23
23
  public static void main(String[] args) {
24
24
 
25
25
  // TODO 自動生成されたメソッド・スタブ
26
+
27
+ Sub sub = new Sub();
26
28
 
27
29
 
28
30
 
@@ -56,7 +58,7 @@
56
58
 
57
59
  } while (sw == true);
58
60
 
59
- new Sub().hoge(answer[i]);
61
+ sub.hoge(answer[i]);
60
62
 
61
63
  }
62
64