createInstance

JS
1.9
fun <T : Any> KClass<T>.createInstance(): T
(source)

Creates a new instance of the class, calling a constructor which either has no parameters or all parameters of which have a default value. If there are no or many such constructors, an exception is thrown.