public class Djie {
String name;
int age;
public Djie (){
this.age=21;
}
public Djie(String name,int age){
this();
this.name="李杰";
}
private void print(){
System.out.println("最终名字="+this.name);
System.out.println("最终的年龄="+this.age);
}
public static void main(String[] args) {
Djie tt=new Djie("",0); //随便传进去的参数
tt.print();
}
}
This的实例化
最新推荐文章于 2022-03-02 16:38:20 发布