Java Class forName forName(String className)

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

Description

for Name

License

Apache License

Declaration

@SuppressWarnings("unchecked")
    public static <T> Class<T> forName(String className) 

Method Source Code

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

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> Class<T> forName(String className) {
        try {/*from   w w  w .  j  a  v a2 s  . co m*/
            return (Class<T>) Class.forName(className);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(className, e);
        }
    }

    @SuppressWarnings("unchecked")
    public static <T> Class<T> forName(String className, boolean initialize, ClassLoader loader) {
        try {
            return (Class<T>) Class.forName(className, initialize, loader);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(className, e);
        }
    }
}

Related

  1. forName(final Class caller, final String className)
  2. forName(final String className)
  3. forName(final String className, final Class caller)
  4. forName(String className)
  5. forName(String className)
  6. forName(String className)
  7. forName(String className)
  8. forName(String className)
  9. forName(String className)