From cabf26d3550ee03e2abfa8df398eab7030102f44 Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 18:05:35 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/github/hcsp/inheritance/Animal.java | 16 +++++++++++++ .../java/com/github/hcsp/inheritance/Cat.java | 24 +++++++++++++------ .../java/com/github/hcsp/inheritance/Dog.java | 21 ++++++++++------ .../java/com/github/hcsp/inheritance/Rat.java | 24 ++++++++++++------- 4 files changed, 63 insertions(+), 22 deletions(-) create mode 100644 src/main/java/com/github/hcsp/inheritance/Animal.java diff --git a/src/main/java/com/github/hcsp/inheritance/Animal.java b/src/main/java/com/github/hcsp/inheritance/Animal.java new file mode 100644 index 0000000..7063cc3 --- /dev/null +++ b/src/main/java/com/github/hcsp/inheritance/Animal.java @@ -0,0 +1,16 @@ +package com.github.hcsp.inheritance; + +public class Animal { + public String name; + + public Animal(String name){ + this.name=name; + } + + public void sayMyName(String name){ + System.out.println("我的名字是"+name); + } + public void call(String voice,String name){ + System.out.println(voice+name); + } +} diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index f86dc38..51543cc 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -1,17 +1,27 @@ package com.github.hcsp.inheritance; -public class Cat { - private String name; +public class Cat extends Animal{ + Cat(String name){ + super(name); + } +// public void cat(String name,String voice){ +// super.sayMyName(name); +// super.call(voice,name); +// } - public Cat(String name) { - this.name = name; - } +// private String name; +// +// public Cat(String name) { +// this.name = name; +// } public void sayMyName() { - System.out.println("我的名字是" + name); + super.sayMyName(name); } public void meow() { - System.out.println("喵" + name); + super.call("喵",name); } + + } diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index 24e713a..0124f9f 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -1,17 +1,24 @@ package com.github.hcsp.inheritance; -public class Dog { - private String name; - - public Dog(String name) { - this.name = name; +public class Dog extends Animal { + public Dog(String name){ + super(name); } +// public void dog(String name,String voice){ +// super.sayMyName(name); +// super.call(voice,name); +// } +// private String name; +// +// public Dog(String name) { +// this.name = name; +// } public void sayMyName() { - System.out.println("我的名字是" + name); + super.sayMyName(name); } public void wang() { - System.out.println("汪" + name); + super.call("汪",name); } } diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index bc517d1..3803b9c 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -1,17 +1,25 @@ package com.github.hcsp.inheritance; -public class Rat { - private String name; - - public Rat(String name) { - this.name = name; +public class Rat extends Animal{ + public Rat(String name){ + super(name); } - +// public void rat(String name,String voice){ +// super.sayMyName(name); +// super.call(voice,name); +// } +// private String name; +// +// public Rat(String name) { +// this.name = name; +// } +// public void sayMyName() { - System.out.println("我的名字是" + name); + super.sayMyName(name); } public void zhizhi() { - System.out.println("吱吱" + name); + super.call("吱吱",name); + } } From fdd73444f36872a4f2d2ac04e1affe654445e5c9 Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 18:36:06 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/github/hcsp/inheritance/Animal.java | 2 +- src/main/java/com/github/hcsp/inheritance/Cat.java | 6 +++--- src/main/java/com/github/hcsp/inheritance/Dog.java | 6 +++--- src/main/java/com/github/hcsp/inheritance/Rat.java | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/github/hcsp/inheritance/Animal.java b/src/main/java/com/github/hcsp/inheritance/Animal.java index 7063cc3..651ac4c 100644 --- a/src/main/java/com/github/hcsp/inheritance/Animal.java +++ b/src/main/java/com/github/hcsp/inheritance/Animal.java @@ -7,7 +7,7 @@ public Animal(String name){ this.name=name; } - public void sayMyName(String name){ + public void sayMyName(){ System.out.println("我的名字是"+name); } public void call(String voice,String name){ diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index 51543cc..67f499b 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -15,9 +15,9 @@ public class Cat extends Animal{ // this.name = name; // } - public void sayMyName() { - super.sayMyName(name); - } +// public void sayMyName() { +// super.sayMyName(name); +// } public void meow() { super.call("喵",name); diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index 0124f9f..9b8a3db 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -14,9 +14,9 @@ public Dog(String name){ // this.name = name; // } - public void sayMyName() { - super.sayMyName(name); - } +// public void sayMyName() { +// super.sayMyName(name); +// } public void wang() { super.call("汪",name); diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index 3803b9c..b3eae02 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -14,9 +14,9 @@ public Rat(String name){ // this.name = name; // } // - public void sayMyName() { - super.sayMyName(name); - } +// public void sayMyName() { +// super.sayMyName(name); +// } public void zhizhi() { super.call("吱吱",name); From a65f8fb440caf447db2bd56e293deac05ead911f Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 18:41:14 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/github/hcsp/inheritance/Cat.java | 2 +- src/main/java/com/github/hcsp/inheritance/Dog.java | 2 +- src/main/java/com/github/hcsp/inheritance/Rat.java | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index 67f499b..4b05321 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -20,7 +20,7 @@ public class Cat extends Animal{ // } public void meow() { - super.call("喵",name); + System.out.println("喵" + name); } diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index 9b8a3db..e176377 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -19,6 +19,6 @@ public Dog(String name){ // } public void wang() { - super.call("汪",name); + System.out.println("汪" + name); } } diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index b3eae02..d0adc3c 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -19,7 +19,9 @@ public Rat(String name){ // } public void zhizhi() { - super.call("吱吱",name); + System.out.println("吱吱" + name); } + + } From 45c3fa13f7780d79c71424295132bf80bc496c47 Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 18:44:01 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/github/hcsp/inheritance/Animal.java | 6 +++--- src/main/java/com/github/hcsp/inheritance/Cat.java | 12 ++++++------ src/main/java/com/github/hcsp/inheritance/Dog.java | 12 ++++++------ src/main/java/com/github/hcsp/inheritance/Rat.java | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/github/hcsp/inheritance/Animal.java b/src/main/java/com/github/hcsp/inheritance/Animal.java index 651ac4c..0e6a0af 100644 --- a/src/main/java/com/github/hcsp/inheritance/Animal.java +++ b/src/main/java/com/github/hcsp/inheritance/Animal.java @@ -3,9 +3,9 @@ public class Animal { public String name; - public Animal(String name){ - this.name=name; - } +// public Animal(String name){ +// this.name=name; +// } public void sayMyName(){ System.out.println("我的名字是"+name); diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index 4b05321..0c15ce0 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -1,9 +1,9 @@ package com.github.hcsp.inheritance; public class Cat extends Animal{ - Cat(String name){ - super(name); - } +// Cat(String name){ +// super(name); +// } // public void cat(String name,String voice){ // super.sayMyName(name); // super.call(voice,name); @@ -11,9 +11,9 @@ public class Cat extends Animal{ // private String name; // -// public Cat(String name) { -// this.name = name; -// } + public Cat(String name) { + this.name = name; + } // public void sayMyName() { // super.sayMyName(name); diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index e176377..57170e8 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -1,18 +1,18 @@ package com.github.hcsp.inheritance; public class Dog extends Animal { - public Dog(String name){ - super(name); - } +// public Dog(String name){ +// super(name); +// } // public void dog(String name,String voice){ // super.sayMyName(name); // super.call(voice,name); // } // private String name; // -// public Dog(String name) { -// this.name = name; -// } + public Dog(String name) { + this.name = name; + } // public void sayMyName() { // super.sayMyName(name); diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index d0adc3c..1e0d8f2 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -1,18 +1,18 @@ package com.github.hcsp.inheritance; public class Rat extends Animal{ - public Rat(String name){ - super(name); - } +// public Rat(String name){ +// super(name); +// } // public void rat(String name,String voice){ // super.sayMyName(name); // super.call(voice,name); // } // private String name; // -// public Rat(String name) { -// this.name = name; -// } + public Rat(String name) { + this.name = name; + } // // public void sayMyName() { // super.sayMyName(name); From d1a1164ce14af7771128a3e413db95ada7835973 Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 18:53:21 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/github/hcsp/inheritance/Animal.java | 6 +++--- src/main/java/com/github/hcsp/inheritance/Cat.java | 4 ++-- src/main/java/com/github/hcsp/inheritance/Dog.java | 4 ++-- src/main/java/com/github/hcsp/inheritance/Rat.java | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/hcsp/inheritance/Animal.java b/src/main/java/com/github/hcsp/inheritance/Animal.java index 0e6a0af..591bfa2 100644 --- a/src/main/java/com/github/hcsp/inheritance/Animal.java +++ b/src/main/java/com/github/hcsp/inheritance/Animal.java @@ -10,7 +10,7 @@ public class Animal { public void sayMyName(){ System.out.println("我的名字是"+name); } - public void call(String voice,String name){ - System.out.println(voice+name); - } +// public void call(String voice,String name){ +// System.out.println(voice+name); +// } } diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index 0c15ce0..aae7ad4 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -9,8 +9,8 @@ public class Cat extends Animal{ // super.call(voice,name); // } -// private String name; -// + private String name; + public Cat(String name) { this.name = name; } diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index 57170e8..668670e 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -8,8 +8,8 @@ public class Dog extends Animal { // super.sayMyName(name); // super.call(voice,name); // } -// private String name; -// + private String name; + public Dog(String name) { this.name = name; } diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index 1e0d8f2..7bb4f5c 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -8,8 +8,8 @@ public class Rat extends Animal{ // super.sayMyName(name); // super.call(voice,name); // } -// private String name; -// + private String name; + public Rat(String name) { this.name = name; } From d05d5c3ebba60f26162e68a1f66916a6b23624d8 Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 19:21:28 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/github/hcsp/inheritance/Animal.java | 10 ++-------- .../java/com/github/hcsp/inheritance/Cat.java | 15 +-------------- .../java/com/github/hcsp/inheritance/Dog.java | 14 +------------- .../java/com/github/hcsp/inheritance/Rat.java | 14 +------------- 4 files changed, 5 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/github/hcsp/inheritance/Animal.java b/src/main/java/com/github/hcsp/inheritance/Animal.java index 591bfa2..ff734a7 100644 --- a/src/main/java/com/github/hcsp/inheritance/Animal.java +++ b/src/main/java/com/github/hcsp/inheritance/Animal.java @@ -1,16 +1,10 @@ package com.github.hcsp.inheritance; public class Animal { - public String name; - -// public Animal(String name){ -// this.name=name; -// } + private String name; public void sayMyName(){ System.out.println("我的名字是"+name); } -// public void call(String voice,String name){ -// System.out.println(voice+name); -// } + } diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index aae7ad4..852cf7f 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -1,24 +1,11 @@ package com.github.hcsp.inheritance; public class Cat extends Animal{ -// Cat(String name){ -// super(name); -// } -// public void cat(String name,String voice){ -// super.sayMyName(name); -// super.call(voice,name); -// } - - private String name; - + String name; public Cat(String name) { this.name = name; } -// public void sayMyName() { -// super.sayMyName(name); -// } - public void meow() { System.out.println("喵" + name); } diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index 668670e..bb9c45d 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -1,23 +1,11 @@ package com.github.hcsp.inheritance; public class Dog extends Animal { -// public Dog(String name){ -// super(name); -// } -// public void dog(String name,String voice){ -// super.sayMyName(name); -// super.call(voice,name); -// } - private String name; - + String name; public Dog(String name) { this.name = name; } -// public void sayMyName() { -// super.sayMyName(name); -// } - public void wang() { System.out.println("汪" + name); } diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index 7bb4f5c..a6ea8a2 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -1,22 +1,10 @@ package com.github.hcsp.inheritance; public class Rat extends Animal{ -// public Rat(String name){ -// super(name); -// } -// public void rat(String name,String voice){ -// super.sayMyName(name); -// super.call(voice,name); -// } - private String name; - + String name; public Rat(String name) { this.name = name; } -// -// public void sayMyName() { -// super.sayMyName(name); -// } public void zhizhi() { System.out.println("吱吱" + name); From e1e33c555829ee12b16d0a5386fc8e36367911ac Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 19:26:17 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/github/hcsp/inheritance/Cat.java | 2 +- src/main/java/com/github/hcsp/inheritance/Dog.java | 2 +- src/main/java/com/github/hcsp/inheritance/Rat.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index 852cf7f..c239472 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -1,7 +1,7 @@ package com.github.hcsp.inheritance; public class Cat extends Animal{ - String name; + private String name; public Cat(String name) { this.name = name; } diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index bb9c45d..f53c6c0 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -1,7 +1,7 @@ package com.github.hcsp.inheritance; public class Dog extends Animal { - String name; + private String name; public Dog(String name) { this.name = name; } diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index a6ea8a2..f329c6c 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -1,7 +1,7 @@ package com.github.hcsp.inheritance; public class Rat extends Animal{ - String name; + private String name; public Rat(String name) { this.name = name; } From 84dff6fbfef3d35818e566ab74bdcd60ab021e74 Mon Sep 17 00:00:00 2001 From: fiymi Date: Fri, 10 Jan 2020 19:35:07 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=BB=83=E4=B9=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/github/hcsp/inheritance/Animal.java | 2 +- src/main/java/com/github/hcsp/inheritance/Cat.java | 2 +- src/main/java/com/github/hcsp/inheritance/Dog.java | 2 +- src/main/java/com/github/hcsp/inheritance/Rat.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/github/hcsp/inheritance/Animal.java b/src/main/java/com/github/hcsp/inheritance/Animal.java index ff734a7..5b8400c 100644 --- a/src/main/java/com/github/hcsp/inheritance/Animal.java +++ b/src/main/java/com/github/hcsp/inheritance/Animal.java @@ -1,7 +1,7 @@ package com.github.hcsp.inheritance; public class Animal { - private String name; + protected String name; public void sayMyName(){ System.out.println("我的名字是"+name); diff --git a/src/main/java/com/github/hcsp/inheritance/Cat.java b/src/main/java/com/github/hcsp/inheritance/Cat.java index c239472..6dc50fc 100644 --- a/src/main/java/com/github/hcsp/inheritance/Cat.java +++ b/src/main/java/com/github/hcsp/inheritance/Cat.java @@ -1,7 +1,7 @@ package com.github.hcsp.inheritance; public class Cat extends Animal{ - private String name; + public Cat(String name) { this.name = name; } diff --git a/src/main/java/com/github/hcsp/inheritance/Dog.java b/src/main/java/com/github/hcsp/inheritance/Dog.java index f53c6c0..7e58fcd 100644 --- a/src/main/java/com/github/hcsp/inheritance/Dog.java +++ b/src/main/java/com/github/hcsp/inheritance/Dog.java @@ -1,7 +1,7 @@ package com.github.hcsp.inheritance; public class Dog extends Animal { - private String name; + public Dog(String name) { this.name = name; } diff --git a/src/main/java/com/github/hcsp/inheritance/Rat.java b/src/main/java/com/github/hcsp/inheritance/Rat.java index f329c6c..04a2317 100644 --- a/src/main/java/com/github/hcsp/inheritance/Rat.java +++ b/src/main/java/com/github/hcsp/inheritance/Rat.java @@ -1,7 +1,7 @@ package com.github.hcsp.inheritance; public class Rat extends Animal{ - private String name; + public Rat(String name) { this.name = name; }