获得对象实例的三种方法

    技术2022-05-11  89

    第一种:

    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(); 


    最新回复(0)