黑马博学谷零基础大数据就业班年度会员版
private static List<Command> getCommandList() {
// 可以从其他地方获取命令,如 Eat 或 Sleep
return null;
}}interface Command {
// Command 就是一个 Runnable
void run();}class Eat implements Command {
@Override
public void run() {
System.out.println("eat!");
}}