【真假分数相加】
//inheritence, extends, use this & super 子类的方法
//two constructors, non-default use 'this' 子类的变量
【Java课程学习】
content
//use string array to fill up content array 填充自定义类型的数组
//print out the guidance menu输出带格式的菜单
//use user's input to choose different type of contents通过用户输入的input来instanceof实例
practiceproblem & video
//PracticeProblem extends继承了Content父类,implements实现了Downloadable接口
//子类的constructor用了super和this关键字
//重写了download接口中的所有方法,有标准化的双引号输出
【annaGUI界面】
//Anagrammar ag = new Anagrammar(); 新建一个ag实例放到界面类来用
//通过TextField类.getText来获得用户输入
//把结果在stringbuilder中append起来
//TextArea.setText随即显示输出格式
//messageLabel.setText显示提示信息
//清空时:TextArea clear, messageLabel设成空字符串“”,退出用Platform.exit();
【宠物叫声界面】
//有static int count的全局变量和talk的抽象方法
//dog是pet的子类,实例化talk方法,有dogcount,增加全局petcount,发出特定叫声
//写三个handler,里面的label用setText
//一定要给Button set action!而且在button设置完成之后,否则点了没用。buttons[0].setOnAction(new CatHandler());
【guest下单】
//guest 有菜名、抽象下单方法
kitchen
//初始化五种新stock & price
//用this关键字updateStock, getStock填充到stock[5]数组
//用布尔型checkStock检查库存
order
//先new dinner&kitchen类
//创建count[4] expense[4]存储四种不同的产品
//用random产生客户类型,传入Guest runDiner(int type)来调用
//用一个单独的calculateBill函数产生income
//标准化输出
couple
//placeOrder()里,每次把expense重新算了一遍
【加热食物】
//heatable借口中提供啥也没有void方法heatIt
//chip类中打印具体的卡路里、声音
//抽象类food的constructor每次都输出here is food, 抽象方法eat啥都没有
main
//用while (!option.equals("n"))来持续获得输入
//如果是pizza,实例化((Pizza)f)来加热
//根据输入的choice来选择食物,Food getFood(int choice)