package inheritance1;
public class Professor extends Person {
private String major;
public String getMajor() {
return major;
}
public void setMajor(String major) {
this.major = major;
}
public void info() {
System.out.println("이름 : " + super.getAge());
System.out.println("나이 : " + super.getName());
System.out.println("전공 : " + major);
System.out.println();
}
}
'Class > 220728' 카테고리의 다른 글
Class 예제(1-1) (0) | 2022.07.28 |
---|---|
Class_Inheritance(1-5) (0) | 2022.07.28 |
Class_Inheritance(1-3) (0) | 2022.07.28 |
Class_Inheritance(1-2) (0) | 2022.07.28 |
Class_Inheritance(1-1) (0) | 2022.07.28 |