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 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());
}
}
这个错误不容易发现。
相关考题:
下列关于PDCA循环理论描述中正确的是A、Play、Do、Check、AbbreviateB、Play、Develop、Check、ActionC、Play、Develop、Capacity、AbbreviateD、Plan、Do、Check、ActionE、Plan、Do、Check、Abbreviate
WhichthreemethodsofsourceNATdoesJUNOSSoftwaresupport?() A.interface-basedsourceNATB.sourceNATwithaddressshiftingC.sourceNATusingstaticsourcepoolD.interface-basedsourceNATwithoutPATE.sourceNATwithaddressshiftingandPAT
Which command shows if an access list is assigned to an interface?() A. show ip interface [interface] access-listsB. show ip access-lists interface [interface]C. show ip interface [interface]D. show ip access-lists [interface]
Usetheoutputfromtheroutershowninthegraphicabovetodeterminewhichofthefollowingarecorrect.() A.Router John uses alink-state routing protocol.B.Router John will receive routing updates on the Serial0/0 interface.C.Router John will receive routing updates on the Serial0/1 interface.D.Router John will send routing updates out the Serial0/0 interface.E.Router John will send routing updates out the FastEthernet0/0 interface.F.Router John will send routing updates out the Serial0/1 interface.
竞技体育演进过程经历的阶段是A.游戏(game)→玩耍(play)→竞技体育(sport)B.玩耍(play)→游戏(game)→竞技体育(sport)C.竞技体育(sport)→玩耍(play)→游戏(game)D.竞技体育(sport)→游戏(game)→玩耍(play)
下列关于interface的说法正确的是:A.interface中可以有private方法B.interface中可以有final方法C.interface中可以有function实现D.interface可以继承其他interface
1、竞技体育演进过程经历的阶段是()。A.游戏(game)→玩耍(play)→竞技体育(sport)B.玩耍(play)→游戏(game)→竞技体育(sport)C.竞技体育(sport)→玩耍(play)→游戏(game)D.竞技体育(sport)→游戏(game)→玩耍(play)
竞技体育演进过程经历的阶段是()。A.游戏(game)→玩耍(play)→竞技体育(sport)B.玩耍(play)→游戏(game)→竞技体育(sport)C.竞技体育(sport)→玩耍(play)→游戏(game)D.竞技体育(sport)→游戏(game)→玩耍(play)
下列关于interface的说法正确的是:A.interface中可以有private方法B.interface中可以有final方法C.interface中可以有方法的具体实现D.interface可以继承其他interface