首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

种的初始化深层剖析案例

2012-12-19 
类的初始化深层剖析案例引自:http://topic.csdn.net/u/20120531/17/286c78d8-77f6-4498-88ab-3c35d88a1f5e

类的初始化深层剖析案例
引自:http://topic.csdn.net/u/20120531/17/286c78d8-77f6-4498-88ab-3c35d88a1f5e.html?96609

public class Test02 {    private int i = getValue();//第2行    private int j = 10;        public int getValue(){        return j;    }        public static void main(String[] args) {        System.out.print(new Test02().i);//第9行    }}/*输出:A 第二行编译错误B 第九行编译错误C 输出:10D 输出:0*/

热点排行