# createInstanceOrNull

@ JvmOverloads
fun < T : Any > Class < T >. createInstanceOrNull (vararg args: Any ?, isPublic: Boolean = true): T ?

Create an instance of Class with the given arguments or return null if not found.

#### Receiver

the Class to be instantiated.

#### Return

T or null if no suitable constructor is found.

#### Parameters

args

the arguments to be passed to the constructor.

isPublic

whether to only consider public constructors, default is true.

#### See also

createInstance
createInstanceAsType
createInstanceAsTypeOrNull

fun < T : Any > KClass < T >. createInstanceOrNull (vararg args: Any ?, isPublic: Boolean = true): T ?

Create an instance of KClass.java with the given arguments or return null if not found.

#### See also

createInstanceOrNull