java newinstance alternative

Java
YourClass.getDeclaredConstructor().newInstance()
Source

Also in Java: