# load

@ JvmOverloads
fun load (loader: ClassLoader ? = null, initialize: Boolean = false): Class < Any >

Load the first class that matches the given names using the specified ClassLoader.

If no class is found, it throws a NoClassDefFoundError.

#### Return

Class

#### Parameters

loader

the ClassLoader to load the class, default is ClassLoaderProvider.classLoader.

initialize

whether to initialize the class with loader, default is false.

#### See also

VariousClass.loadOrNull

#### Throws

NoClassDefFoundError

if no class is found.

@ JvmOverloads
@ JvmName (name = "loadTyped")
fun < T : Any > load (loader: ClassLoader ? = null, initialize: Boolean = false): Class < T >

Load the first class that matches the given names using the specified ClassLoader.

#### Return

Class<T>

#### See also

VariousClass.load
VariousClass.loadOrNull

#### Throws

NoClassDefFoundError

if no class is found.

IllegalStateException

if the class cannot be cast to type T.