Java Class Load loadClass(String inClassName)

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

Description

load Class

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> Class<T> loadClass(String inClassName) throws ClassNotFoundException, ClassCastException 

Method Source Code

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

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> Class<T> loadClass(String inClassName) throws ClassNotFoundException, ClassCastException {

        try {//from w ww. java2s .c o m

            return (Class<T>) ClassLoader.getSystemClassLoader().loadClass(inClassName);

        } catch (final Exception e) {
            // swallow
        }

        return (Class<T>) Thread.currentThread().getContextClassLoader().loadClass(inClassName);
    }
}

Related

  1. loadClass(String className, ClassLoader classLoader)
  2. loadClass(String className, ClassLoader classLoader)
  3. loadClass(String clazz, ClassLoader cl)
  4. loadClass(String fqcn, Class... classes)
  5. loadClass(String h, String prefix)
  6. loadClass(String name)
  7. loadClass(String name)
  8. loadClass(String name)
  9. loadClass(String name)