import java.lang.reflect.Constructor;
public class Instance {
public static void main(String[] args)throws Exception {
Class localClass = Class.forName("ins.Instance");
Constructor localConstructor = localClass.getConstructor(new Class[0]);
Instance localInstance = (Instance)localConstructor.newInstance(new Object[0]);
localInstance.p();
}
void p(){
System.out.println("不使用new ,使用反射,实例化一个对象!");
}
}