Here you can find the source of toString(ClassLoader loader)
public static String toString(ClassLoader loader)
//package com.java2s; //License from project: LGPL import java.net.URLClassLoader; import java.util.Arrays; public class Main { public static String toString(ClassLoader loader) { if (loader instanceof URLClassLoader) { URLClassLoader ul = (URLClassLoader) loader; return "URLClassLoader" + Arrays.asList(ul.getURLs()).toString(); }//w w w . j a v a2s .co m return String.valueOf(loader); } }