摘要: 虽然是第二次看,感觉这部分还是要仔细看。多形性是面向对象编程语言的第三中特性。首先是上溯造型(这个是什么意思就不说了),为什么需要上溯造型呢?很多书上都会用“画图”或者“乐器”的程序来和大家解释:class Note{ private int value; private Note(int val) { value = val; } public static final Note middleC = new Note(0), cSharp = new Note(1), cFlat = new Note(2);} // Etc.class Instrument { public void pl 阅读全文
posted @ 2011-07-26 22:45 GG大婶 阅读(471) 评论(0) 推荐(0) 编辑