public static < T > T createInstance ( Class < T > cls , Object ... args ) { Class < ? > [ ] argTypes = new Class < ? > [ args . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) { argTypes [ i ] = args [ i ] . getClass ( ) ; } return createInstance ( cls , args , argTypes ) ; }
Method that can be called to try to create an instantiate of specified type .