質問編集履歴

2

変更

2019/02/23 08:23

投稿

vitabrevisarsl1
vitabrevisarsl1

スコア57

test CHANGED
File without changes
test CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
  class MissingNameException extends Exception { }
6
6
 
7
- class Customer {
7
+ class Patron {
8
8
 
9
9
  private int id;
10
10
 
11
11
  private String name;
12
12
 
13
- public Customer(int id, String name) throws Exception {
13
+ public Patron(int id, String name) throws Exception {
14
14
 
15
15
  if (id < 1) {
16
16
 
@@ -36,19 +36,19 @@
36
36
 
37
37
  }
38
38
 
39
- public class Test_W6_13 {
39
+ public class Owner {
40
40
 
41
41
  //public static void main(String[] args) { // 1.add throws declaration 2.surround with try/catch
42
42
 
43
43
  public static void main(String[] args) throws Exception {
44
44
 
45
- Customer c1 = new Customer(101, "Duke");
45
+ Patron p1 = new Patron(101, "Beethoven");
46
46
 
47
- Customer c2 = new Customer(102, "Java");
47
+ Patron p2 = new Patron(102, "Mozart");
48
48
 
49
- System.out.print(c1);
49
+ System.out.print(p1);
50
50
 
51
- System.out.print(c2);
51
+ System.out.print(p2);
52
52
 
53
53
  }
54
54
 

1

誤字

2019/02/23 08:23

投稿

vitabrevisarsl1
vitabrevisarsl1

スコア57

test CHANGED
File without changes
test CHANGED
@@ -56,7 +56,7 @@
56
56
 
57
57
  ```
58
58
 
59
- ある問題集のスクリプトですが、throws を書いているのに catch がないのですが、エラーなく実行でてしまいます。
59
+ ある問題集のスクリプトですが、throws を書いているのに catch がないのですが、エラーなく実行でてしまいます。
60
60
 
61
61
 
62
62