package chapter20230821;
class Person {
void breath() {
System.out.println("숨쉬기");
}
void eat() {
System.out.println("밥먹기");
}
void say() {
System.out.println("말하기");
}
}
class Student extends Person {
void learn() {
System.out.println("배우기");
}
}
class Teacher extends Person {
void teach() {
System.out.println("가르치기");
}
}
public class test04 {
public static void main(String[] args) {
Student student = new Student();
student.breath();
student.learn();
student.say();
Teacher teacher = new Teacher();
teacher.eat();
teacher.teach();
teacher.say();
Person person = new Person();
person.breath();
}
}