- package demo;
- public class PingPangballPlayer extends Player implements SpeakEnglish {
- public PingPangballPlayer() {
- }
- public PingPangballPlayer(String name, int age) {
- super(name, age);
- }
- @Override
- public void eat() {
- System.out.println(getName()+"吃窝窝头,大馒头");
- }
- @Override
- public void study() {
- System.out.println(getName()+"学习如何发球和接球");
- }
- @Override
- public void speak() {
- System.out.println(getName()+"说英语");
- }
- }
复制代码 |
|