How to create new instance from class name in gwt

后端 未结 3 1657
离开以前
离开以前 2020-12-08 06:13

I have a class int the following name com.test.TestClass

At one point in my code I have to get instance of this class by only having the class name stri

3条回答
  •  误落风尘
    2020-12-08 06:25

    GWT.create( Reflection.class ).instantiate( YourClass.class );

    Why don't you use then just GWT.create( YourClass.class ); ?

    Maybe you ment GWT.create( Reflection.class ).instantiate( "YourClass" );

提交回复
热议问题