正在加载图片...
初假么段行示州() Class Bowl Bowl(int maker){ System.out.println("Bowl("+maker +")") void f(int maker){ System.out.println(“f(”+maker+“)”);} Class Table static Bowl b1 new Bowl(1); Table({ System.out.println("Table()"); b2.f1);} void f2(int maker){ System.out.println(“2(”+maker+)");} static Bowl b2 new Bowl(2);5-14 Programming in Java Class Bowl { Bowl(int maker) { System.out.println(“Bowl(” + maker + “)”); } void f(int maker) { System.out.println(“f(” + maker + “)”); } } Class Table { static Bowl b1 = new Bowl(1); Table() { System.out.println(“Table()”); b2.f(1); } void f2(int maker) { System.out.println(“f2(” + maker + “)”); } static Bowl b2 = new Bowl(2); } 初始化顺序示例二( 1 )
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有