Javatpoint Logo
Javatpoint Logo

Java Thread getContextClassLoader() method

The getContextClassLoader() method of thread class returns the context ClassLoader for the thread.

Syntax

Return

It returns the context ClassLoader for the Thread.

Exception

SecurityException: If the current thread cannot get the context ClassLoader.

Example

Test it Now

Output:

Context ClassLoader = jdk.internal.loader.ClassLoaders$AppClassLoader@7c53a9eb
Parent = jdk.internal.loader.ClassLoaders$PlatformClassLoader@ed17bee
Class = class jdk.internal.loader.ClassLoaders$AppClassLoader
Thread is running






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