/**
* 引用构造方法
* @author zhouyu260
*
*/
public class ReferenceConstructor {
int a;
public ReferenceConstructor() {
//这里不能出现任何可执行代码,例如System.out.print(a);
this(5);
}
public ReferenceConstructor(int a) {
this.a = a;
}
}
使用this引用构造方法
最新推荐文章于 2023-12-28 20:43:04 发布