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