JDK 9 RFR of JDK-8159330: Improve deprecation text for Class.newInstance

joe darcy joe.darcy at oracle.com
Mon Jun 13 03:43:16 UTC 2016


On 6/12/2016 7:21 PM, Wang Weijun wrote:
> Why not just clazz.getConstructor().newInstance()?

That seems to work to and is much shorter; thanks :-)

-Joe

>
>> +     * can be replaced by
>> +     *
>> +     * <pre>{@code
>> +     * clazz.getConstructor(new Class<?>[0]).newInstance((Object[])null);
>> +     * }</pre>



More information about the core-libs-dev mailing list