What to use instead of Class.newInstance()? November 22, 2022 by Tarik To quote Java 9’s javadoc: The call clazz.newInstance() can be replaced by clazz.getDeclaredConstructor().newInstance()