Java Class Load classForName(String className)

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

Description

class For Name

License

Apache License

Declaration

public static Class<?> classForName(String className) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static Class<?> classForName(String className) {
        try {//w ww  .  j  av  a  2 s .c o m
            return Class.forName(className, false, Thread.currentThread().getContextClassLoader());

        } catch (Exception ignore) {
            try {
                return Class.forName(className);
            } catch (Exception e) {
                throw new IllegalArgumentException("classForName(" + className + ")  with ex:", e);
            }
        }
    }
}

Related

  1. classForName(final String className)
  2. classForName(final String clsName)
  3. classForName(final String theClassName)
  4. classForName(String className)
  5. classForName(String className)
  6. classForName(String className)
  7. classForName(String className)
  8. classForName(String className)