[code]class PersonTest2
{
public static void main(String[] args)
{
//Person p1=new Person();
//p1.Yan();
Person p=new Person("花花",17);//
p.Yan();
}
}
class Person
{
private static String name;
private static int age;
public Person(){}
public Person(String name,int age)
{
this.name=name;
this.age=age;
}
public void Yan()
{
System.out.println(name+"***"+age);
}
static
{
System.out.println(name+"***"+age);
}
{
System.out.println(name+"***"+age);
}
}
|
|