本帖最后由 ztw 于 2014-7-27 14:38 编辑
为什么一下代码不能编译呢?
class Person{
private String name;
private int age;
Person(){}
Person(int age){
this.age = age;
}
Person(String name,int age){
this.name = name;
this(age);
System.out.println("age = "+ age);
}
}
class Test{
public static void main(String[] args){
Person p = new Person("zt",20);
}
} |
|