class Person
{
int age;
String name;
Person()
{
System.out.println("person run");
}
Person(String name,int age)
{
this.name = name;
this.age = age;
}
Person(int age)
{
this.age = age;
}
public void speak()
{
System.out.println(this.name+":::"+this.age);
}
}
class YunSuan1116
{
public static void main(String[] args)
{
Person p = new Person("lisi",29);
p.speak();
}
}
这个是什么原因,求指导.
|