摘要: Unlike methods, a constructor cannot be abstract, static, final, native or synchronized. 1. A constructor is not inherited, so there is no need to dec... 阅读全文
posted @ 2014-11-20 11:03 kongmeng 阅读(777) 评论(0) 推荐(1) 编辑
摘要: 一个Java文件中可以包含多个类。如果有public类,则文件名必须和public类一样。例如: 1 class Pie { 2 void f(){ 3 System.out.println("Pie.f()"); 4 } 5 } 6 7 class Cake { 8 ... 阅读全文
posted @ 2014-11-20 09:32 kongmeng 阅读(208) 评论(0) 推荐(0) 编辑