質問編集履歴

1

RuntimeExceptionからAssertionErrorに変更

2023/05/22 06:53

投稿

tku_ab
tku_ab

スコア7

test CHANGED
File without changes
test CHANGED
@@ -29,10 +29,10 @@
29
29
 
30
30
  class Square extends Rectangle {
31
31
  public void setWidth(int width) {
32
- throw new RuntimeException("please use setSize method");
32
+ throw new AssertionError("please use setSize method");
33
33
  }
34
34
  public void setHeight(int height) {
35
- throw new RuntimeException("please use setSize method");
35
+ throw new AssertionError("please use setSize method");
36
36
  }
37
37
 
38
38
  public void setSize(int size) {
@@ -58,12 +58,12 @@
58
58
 
59
59
  @Override
60
60
  public void setWidth(int width) {
61
- throw new RuntimeException("please use setSize method");
61
+ throw new AssertionError("please use setSize method");
62
62
  }
63
63
 
64
64
  @Override
65
65
  public void setHeight(int height) {
66
- throw new RuntimeException("please use setSize method");
66
+ throw new AssertionError("please use setSize method");
67
67
  }
68
68
 
69
69
  }