Persönliche Notizen
Human.java
public class Human {
String name;
int age;
String country;
void walk() {
System.out.println("gehen");
}
void sleep() {
System.out.println("schlafen");
}
}
SoccerPlayer.java
public class SoccerPlayer extends Human {
void run() {
System.out.println("Lauf");
}
void kick() {
System.out.println("Trete");
}
public static void main(String[] args) {
SoccerPlayer soccer = new SoccerPlayer();
soccer.walk();
soccer.sleep();
soccer.run();
soccer.kick();
}
}
Recommended Posts