/**
*
*/
package com.bsdmlx;
import java.lang.reflect.Constructor;
/**
* @author Administrator
*
*/
public class Test9 {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO 自动生成的方法存根
Class clazz = Class.forName("com.bsdmlx.Student");
Constructor c =clazz.getConstructor(String.class,int.class);
}
class Student{
private String name;
private int age;
public Student(String name,int age){
this.name=name;
this.age=age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
|
|