本帖最后由 呆呆呆 于 2013-12-23 10:32 编辑
- interface Playable
- {
- void play();
- }
- interface Bounceable
- {
- void play();
- }
- interface Rollable extends Playable, Bounceable
- {
- Ball ball = new Ball("PingPang");
- }
- class Ball implements Rollable
- {
- private String name;
- public String getName()
- {
- return name;
- }
- public Ball(String name)
- {
- this.name =name;
- }
- public void play()
- {
- ball = newBall("Football");
- System.out.println(ball.getName());
- }
- }
复制代码
这段代码有什么错误,搞不明白。
|