Java Class forName forNameOrNull(String className)

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

Description

for Name Or Null

License

Apache License

Declaration

public static Class<?> forNameOrNull(String className) 

Method Source Code

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

public class Main {
    public static Class<?> forNameOrNull(String className) {
        try {//from w w w .  ja  v  a2  s.c o m
            return Class.forName(className);
        } catch (ClassNotFoundException e) {
            return null;
        }
    }
}

Related

  1. forName(String origClassName)
  2. forName(String type, Class cast)
  3. forName(String[] classNames)
  4. forNameElseNull(final String fullName)
  5. forNameNoException(String className)
  6. forNames(String[] classNames)