Here you can find the source of loadClass(Class sourceClass, final String className)
public static Class loadClass(Class sourceClass, final String className)
//package com.java2s; public class Main { public static Class loadClass(Class sourceClass, final String className) { try {/*from www.j a v a 2 s. com*/ ClassLoader loader = sourceClass.getClassLoader(); if (loader != null) { return loader.loadClass(className); } else { return (Class) Class.forName(className); } } catch (ClassNotFoundException e) { // ignore - maybe log? } return null; } }