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 = new Ball("Football"); System.out.println(ball.getName()); }
}
"interface Rollable extends Playable, Bounceable"没有问题啊,interface可以继承多个interfaces,问题是出在哪?各位大侠帮忙看看 |