-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathStudent.java
More file actions
38 lines (30 loc) · 909 Bytes
/
Student.java
File metadata and controls
38 lines (30 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package inheritanceTutorial;
public class Student extends Person{
private String school;
private String uniform;
public Student (String name, int age, String email, String school, String uniform) {
super(name, age, email);
this.school = school;
this.uniform = uniform;
}
public String getSchool() {
return school;
}
public void setSchool(String school) {
this.school = school;
}
public String getUniform() {
return uniform;
}
public void setUniform(String uniform) {
this.uniform = uniform;
}
public void showStudent() {
String result = super.toString() + " School: " + school + " Uniform: " + uniform;
System.out.println(result);
}
// @Override
// public String toString() {
// return super.toString() + " School: " + school + " Uniform" + uniform;
// }
}