[试题]

interface Playable {

void play();

}

interface Bounceable {

void play();

}

interface Rollable extends Playable, Bounceable {

B.all 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(); } inte

[试题]interface Playable {void play();}interface Bounceable {void play();}interface Rollable extends Playable, Bounceable {B.all ball = new Ball("PingPang");}class Ball implements Rollable {private String name;public String getName() {return name;}public

  • 查看答案
  • What’s the difference between an interfa

    [主观题]What’s the difference between an interface and abstract class?(接口与抽象类有什么区别)

  • 查看答案
  • In a purifier, the interface between the

    [单选题]In a purifier, the interface between the liquid seal and the oil should be positioned as close as possible to ().A . the outlet of oilB . the outlet of waterC . the bowl peripheryD . the center of bowl

  • 查看答案
  • Edward, you play so well. But I you play

    [单选题]E.dward, you play so well. But I you played the piano. A. didn’t know B. hadn’t known C. don’t know D. haven’t known

  • 查看答案
  • 接口(interface)是指:()

    [填空题] 接口(interface)是指:()

  • 查看答案
  • The position of the interface between oi

    [单选题]The position of the interface between oil and water within the centrifuge is achieved by the use of ().A . gravity discB . centrifugal bowlC . a stack of discsD . main sealing ring

  • 查看答案
  • Which of following interface are not usi

    [单选题]Which of following interface are not using CCS7 protocol?()A . GnB . GdC . GsD . Gr

  • 查看答案
  • Bluetooth is a universal radio interface

    [单选题]B.luetooth is a universal radio interface in the(71)frequency hand that enables portable electronic devices to connect and communicate wirelessly via short-range, ad hoc networks. Each unit can simultaneously communicate with up to(72)other units per

  • 查看答案
  • A user interface can be defined as the

    [单选题]A user interface can be defined as the combination of hardware and software that helps people and computers (72) with each other.(72) A.intercourseB.intercommunionC.communicateD.intercommunicate

  • 查看答案
  • When will they get there for the play?

    [单选题]When will they get there for the play?A. 9:00. B. 10:00. C. 10:30.

  • 查看答案