Java Class Load loadClass(String className)

Here you can find the source of loadClass(String className)

Description

load Class

License

Open Source License

Declaration

public static Class<?> loadClass(String className) throws RuntimeException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static Class<?> loadClass(String className) throws RuntimeException {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        return loadClass(className, cl);
    }/*from w w w.  j ava  2  s  .co  m*/

    public static Class<?> loadClass(String className, ClassLoader cl) throws RuntimeException {
        if (cl == null) {
            return loadClass(className);
        }

        Class<?> clazz;
        try {
            clazz = cl.loadClass(className);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException("Error loading class [" + className + "]", e);
        }
        return clazz;
    }
}

Related

  1. loadClass(String className)
  2. loadClass(String className)
  3. loadClass(String className)
  4. loadClass(String className)
  5. loadClass(String className)
  6. loadClass(String className)
  7. loadClass(String className, boolean isInitialized)
  8. loadClass(String className, Class callingClass)
  9. loadClass(String classname, Class clazz)