Javatpoint Logo
Javatpoint Logo

Java Class getClassLoader() Method

The getClassLoader() method of java Class class returns the class loader for the class which called this method. If this class is loaded by the bootstrap class loader, then it will return null.

Syntax

Parameter

No parameter is passed.

Returns

Return the class loader.

Throws

SecurityException

Example 1

Test it Now

Output:

Associated with ClassLoader = sun.misc.Launcher$AppClassLoader

Example 2

Test it Now

Output:

System class is used...

Next TopicJava Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA