首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件开发 >

设计形式之模板模式

2013-07-16 
设计模式之模板模式public class Main {public static void main(String[] args) {//考个历史吧HistoryExa

设计模式之模板模式
public class Main {public static void main(String[] args) {//考个历史吧HistoryExamination historyExamination = new HistoryExamination();historyExamination.templatMethod();System.out.println("--------------------");//考个数学吧,老师有话说哟MathExamination mathExamination = new MathExamination();mathExamination.hook=true;mathExamination.templatMethod();}}

?

结果:

?

?分发历史试卷
做历史试卷
上交历史试卷
--------------------
分发数学试卷
好好做题不要抄
做数学试卷
上交数学试卷

?

参考源文档 <http://blog.csdn.net/s464036801/article/details/8468926> ,此处致谢

?

?

?

?

?

?

热点排行