package com.human;
public interface Human{
void live();
}
package com.human;
public abstract class Woman implements Human{
void say(){
System.out.println("나는 여자");
}
}
package com.human;
public class Player extends Woman{
@Override
void say() {
super.say();
}
@Override
public void live() {
System.out.println("나는 살아있다.");
}
}
package com.human;
public class Exam1{
public static void main(String[] args) {
//Player 객체를 만든다.
//상속 Human ->Woman->Player
//Human - 메서드 live(){살아있다. 출력}
//Woman - 메서드 say(){나는 여자라서 출력}
//
Player p1= new Player();
p1.say();
p1.live();
}
}