JavaQuick Tip: Class Loader Details in Java

Quick Tip: Class Loader Details in Java

Java Developer Tutorials

In this quick tip Java programming tutorial, developers will learn how to use the class loader object in Java and obtain details about the class loader. The following example illustrates how to use class loader objects in Java:

*/

import java.util.*;

public class ClassLoaderDetails {
	
	public static void main(String[] args) 
	{  
		ClassLoaderDetails classLoaderDetails = new ClassLoaderDetails();
		classLoaderDetails.proceed();
	}

	private void proceed()  
	{
		System.out.println(ClassLoaderDetails.class.getClassLoader());
	}
}

/*

Note, the output of running this code example in your integrated development environment (IDE) or code editor might be different based on the Java development environment that you are using. Here is the expected output of running this code:

[root@mypc]# java ClassLoaderDetails
sun.misc.Launcher$AppClassLoader@73d16e93

Read more Java programming tutorials.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories