📄 nonemptyballlist.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 theOval, BallListInterface theRest) { oval = theOval; 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 + -