摘要: 先列出一个类:package usage._of._final;public class ClassWithOutFinal { public void method1(int i) { System.out.println(2 * method2(i)); } public int method2(int i) { return i; }}该类有两个方法,method1调用到了method2,该类并没有被final修饰,也没有文档说明method1的结果是被method2影响的。再来看的效果:package usage._of._final... 阅读全文
posted @ 2012-04-25 10:04 荒土 阅读(351) 评论(0) 推荐(0)