class constructor {
public static void main(String[] args) {
person p = new person();
p.show();
}
}
class person
{
private String name;
private int age;
public person() {
System.out.println("Hello World!");
name = "张三";
age = 23 ;
}
public void show(){
System.out.println(name + age);
}
}
这个里面 public person 与public void show是一种方法嘛
|
|