摘要: 1. 什么是异常2. 异常的分类3. try...catch..finally结构的使用方法1. 什么是异常 异常:中断了 正常指令流的 事件 异常 是在程序运行的时候产生的1 class Test{2 public static void main(String args []){3 ... 阅读全文
posted @ 2014-05-20 11:09 Mirrorhanman 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1. 为什么要用接口2. 工厂方法模式1. 为什么要用接口 之前的打印机程序, open、close、print对于惠普、佳能实际上应该都是不同的, 不同的打印机, 开机、关机、打印都应该不同 所以更靠谱的是将Printer定义为interface类型1 interface Printer{2 ... 阅读全文
posted @ 2014-05-20 10:38 Mirrorhanman 阅读(195) 评论(0) 推荐(0) 编辑