refactor
This commit is contained in:
1 parent
062beda77e
commit
b0055a87bd
25 files changed
+40
-93
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package school;
|
||||
|
||||
public class Teacher extends Person {
|
||||
private String teacherID;
|
||||
|
||||
public Teacher(String name, int age, String teacherID) {
|
||||
super(name, age);
|
||||
this.teacherID = teacherID;
|
||||
}
|
||||
|
||||
public void speak() {
|
||||
System.out.println("I am a teacher, my name is " + getName() + ", and I am " + getAge()
|
||||
+ " years old. My teacher ID is " + teacherID + ".");
|
||||
}
|
||||
|
||||
public String getTeacherID() {
|
||||
return teacherID;
|
||||
}
|
||||
|
||||
public void setTeacherID(String teacherID) {
|
||||
this.teacherID = teacherID;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user