Personal notes
Human.java
public class Human {
String name;
int age;
String country;
void walk() {
System.out.println("walk");
}
void sleep() {
System.out.println("sleep");
}
}
SoccerPlayer.java
public class SoccerPlayer extends Human {
void run() {
System.out.println("Run");
}
void kick() {
System.out.println("Kick");
}
public static void main(String[] args) {
SoccerPlayer soccer = new SoccerPlayer();
soccer.walk();
soccer.sleep();
soccer.run();
soccer.kick();
}
}
Recommended Posts