Initial commit

This commit is contained in:
xixu-me committed 2024-03-17 22:31:48 +08:00
commit 054b77ccdd
27 files changed
+1362

No files matched your search

@@ -0,0 +1,21 @@
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;
}
}