/*使用反射调用私有方法/
public class MyReflect {
public static Object call(String className,String[] constructor,String methodName,String[] methodParmeter) {
Class aClass = null;
Properties properties = new Properties();
try {
properties.load(new FileReader(“student.txt”));
String address = properties.getProperty(className);
aClass = Class.forName(address);
} catch (Exception e) {
e.printStackTrace();
}
/*获得类模板/
Object objectB = null;
try {
/*调用构造方法产生对象/
if (constructor != null) {
objectB = aClass.getConstructor(String.class).newInstance(constructor);
}else{
objectB =aClass.newInstance();
}
} catch (Exception e) {
e.printStackTrace();
}
/**获得所有方法包括私有的 数组*/
Method[] methods = aClass.getDeclaredMethods();