`
^佐依^
  • 浏览: 17542 次
  • 性别: Icon_minigender_2
  • 来自: 惠安
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

Toy Program 2

 
阅读更多

查错:

interface Playable {
	void play();
}

interface Bounceable {
	void play();
}

interface Rollable extends Playable, Bounceable {
	Ball ball = new Ball("PingPang");
}

public 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可以继承多个intefaces。

 

题出在interface Rollable里的"Ball ball = new Ball("PingPang");"

HINT:任何在interface里声明的interface variable (接口变量,也可称成员变量),默认为public static final

分享到:
评论

相关推荐

    基于ssh架构的论坛 只是一个toy program 适合大学做课程设计

    这是我期末做的课程设计 是基于ssh + mssqlver的 只是一个小程序 有需要的同学可以下载 呵呵 应付老师足够了

    Introduction to 64Bit Windows Assembly

    The Toy Box allows the use to enter variable definitions and expressions in either C++ or Fortran and it builds a program to evaluate the expressions. Then the user can inspect the format of each ...

    Learn Electronics with Arduino

    Do you have an idea for a new proof-of-concept tech device or electronic toy but have no way of testing the feasibility of the device? Have you accumulated a junk box of electronic parts and are now ...

    Mathematica programming: an advanced introduction

    program design and development, simulations etc are used. Mathematica seems to be an ideal tool for development of toy - models, prototypes, or just ideas. While Mathematica may be also quite useful ...

    professional_windows_embedded_compact_7.pdf

    Learn to program an array of customized devices and solutions As a compact, highly efficient, scalable operating system, Windows Embedded Compact 7 (WEC7) is one of the best options for developing a ...

    Introduction to Programming in Java 2nd Robert Sedgewick

    Introduction to Programming in Java, Second Edition, by Robert Sedgewick and Kevin Wayne is an accessible, interdisciplinary treatment that emphasizes important and engaging applications, not toy ...

    nodejs in action 英文

    Around the "Ajax revolution" in 2005, JavaScript went from being a "toy" language to something people write real and significant programs with. Some of the notable firsts were Google Maps and Gmail ...

    [黑莓游戏开发学习][Learn BlackBerry Games Development]

    How to program games for any BlackBerry device, from the earliest Java-enabled smartphones to models that run the latest BlackBerry 5 operating system How to build games for two players or the whole ...

    Introduction to Programming in Java, 2nd Edition (2017.4出版.EPUB格式)

    Introduction to Programming in Java, Second Edition, by Robert Sedgewick and Kevin Wayne is an accessible, interdisciplinary treatment that emphasizes important and engaging applications, not toy ...

    智能循迹避障小车设计毕业设计.docx

    Car is running the program, under the existing toy electric car, based on the installation of super sonic sensor and infrared sensors, to achieve the location of electric vehicles,operational status ...

    Vulcain:面向Vulkan的图形的玩具项目

    Toy project for Vulkan oriented graphics Copyright (C) 2021 Guillaume Vara This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as...

    接力:普通话连词

    fn double [n] () { (n * 2 )}( 9 ) .double .println .-- output: 18 -- Um programa que conta até dez( 0 ) . set i .while i <= 10 { (i) . println . (i + 1 ) . set i .} -- Calcula o fatorial de um n...

    计算机应用技术(实用手册)

    AMI BIOS (C) 2006 American megatrends,INC.ASUS P5B-Delusxe ACPI BIOS Revision 0507 CPU: INTEL(R) CORE(TM)2 CPU 6400 @ 2.13GHz Speed :4.01GHz Count :2 AMI公司2006年开发的BIOS版本信息,华硕主板采用的...

Global site tag (gtag.js) - Google Analytics