public class num4 {
public static void main(String[]args)throws Exception{
//结合泛型,使程序更安全
Constructor<person> ct=person.class.getConstructor(String.class,int.class);
person p=ct.newInstance("伍仪华",20);
}
class person1 {
private String Name;
private int Age;
public String getName() {
return Name;
}
public void setName(String name) {
Name = name;
}
public int getAge() {
return Age;
}
public void setAge(int age) {
Age = age;
}
public person1(String name, int Age){
this.Name=Name;
this.Age=Age;
}
}