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 Staff extends Person {
|
||||
private String staffID;
|
||||
|
||||
public Staff(String name, int age, String staffID) {
|
||||
super(name, age);
|
||||
this.staffID = staffID;
|
||||
}
|
||||
|
||||
public void speak() {
|
||||
System.out.println("I am a staff, my name is " + getName() + ", and I am " + getAge()
|
||||
+ " years old. My staff ID is " + staffID + ".");
|
||||
}
|
||||
|
||||
public String getStaffID() {
|
||||
return staffID;
|
||||
}
|
||||
|
||||
public void setStaffID(String staffID) {
|
||||
this.staffID = staffID;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user