spring-framework / org.springframework.beans / BeanUtils / instantiate

instantiate

open static fun <T : Any> instantiate(clazz: Class<T>): T

Convenience method to instantiate a class using its no-arg constructor.

Parameters

clazz - class to instantiate

Exceptions

BeanInstantiationException - if the bean cannot be instantiated

Return
the new instance

See Also
Class#newInstance()