⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nonemptyballlist.java

📁 书籍"Java_面向事件编程"的附带光盘代码
💻 JAVA
字号:
import objectdraw.*;//  A non-empty ball list.  This list contains a single ball,// and the rest of the list after the first ball.public class NonEmptyBallList implements BallListInterface {        private FilledOval oval;    private BallListInterface rest;        // Create a list out of a single ball and the rest of the list    public NonEmptyBallList(FilledOval anOval, BallListInterface theRest) {        oval = anOval;        rest = theRest;    }        public boolean isEmpty() {        return false;    }        // Return the first element.    public FilledOval getFirst() {        return oval;    }        // Return the ListInterface object that represents the rest     // of the list.    public BallListInterface getRest() {        return rest;    }    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -