04 2018 档案

摘要:1.阅读下面程序,分析是否能编译通过?如果不能,说明原因。应该如何修改?程序的运行结果是什么?为什么子类的构造方法在运行之前,必须调用父 类的构造方法?能不能反过来? ~~~ class Grandparent { public Grandparent() { System.out.println( 阅读全文
posted @ 2018-04-19 22:05 丁啸宇 阅读(84) 评论(0) 推荐(0) 编辑
摘要:1.什么是构造方法?什么是构造方法的重载?下面的程序是否可以通过编译?为什么? ~~~public class Test { public static void main(String args[]) { Foo obj = new Foo(); } } class Foo{ int value; 阅读全文
posted @ 2018-04-01 21:54 丁啸宇 阅读(104) 评论(0) 推荐(0) 编辑