class person_1
{
private String name;
private int age;
{
System.out.println("person is run");
}
person_1()//构造函数和类同名
{
System.out.println("A.name="+name+" "+"A.age="+age);
}
{
//name = n;
this.name = name;
System.out.println("B.name="+name+" "+"B.age="+age);
} |
|