class test
{
public static myclass x;
test() {
try {
x=new myclass();
//x is not null here
} catch(Exception e) {/*stuff*/}
//not null here
}
//x is null here in any other member method
}
请解释这种行为的原因?一旦构造函数块结束,构造函数是否不需要保留值而不是丢失它?