获得对象实例的三种方法

第一种:

Test test=new Test();

 

第二种:

test=Class.forName(Test).newInstance();

 

第三种

String interceptorName="org.aaa.Test";
Class interceptorClass=Current.class.getClassLoader().loadClass(interceptorName);
Interceptor inerceptor=(Interceptor)interceptorClass.newInstance(); 



你可能感兴趣的:(对象)