-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeacher.java
More file actions
48 lines (46 loc) · 1007 Bytes
/
Copy pathTeacher.java
File metadata and controls
48 lines (46 loc) · 1007 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
39
40
41
42
43
44
45
46
47
48
package reflection;
public class Teacher extends Person{
private String name;
private String school;
private Integer age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSchool() {
return school;
}
public void setSchool(String school) {
this.school = school;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Teacher() {
super();
// TODO Auto-generated constructor stub
this.name="teacher";
this.school="school";
this.age=0;
}
public Teacher(String name, String school, Integer age) {
super();
this.name = name;
this.school = school;
this.age = age;
}
@Override
public String toString() {
return "Teacher [name=" + name + ", school=" + school + ", age=" + age + "]";
}
@Override
public void getInfo() {
// TODO Auto-generated method stub
System.out.println("I'm a teacher");
}
}