Code example for Constructor

Methods: setAccessiblenewInstance

0
 
    protected CustomEventInterstitial internalCreate(String className) throws Exception {
        Class<? extends CustomEventInterstitial> interstitialClass = Class.forName(className)
                .asSubclass(CustomEventInterstitial.class);
        Constructor<?> interstitialConstructor = interstitialClass.getDeclaredConstructor((Class[]) null);
        interstitialConstructor.setAccessible(true);
        return (CustomEventInterstitial) interstitialConstructor.newInstance();
    } 
} 
Experience pair programming with AI  Get Codota for Java