Here you can find the source of forName(final String className)
Class
object associated with the class or interface with the given string name.
Parameter | Description |
---|---|
className | the fully qualified name of the desired class. |
Class
or null
public static Class<?> forName(final String className)
//package com.java2s; //License from project: LGPL public class Main { /**//from w w w . j av a 2s . c o m * Returns the <code>Class</code> object associated with the class or * interface with the given string name. * * @param className * the fully qualified name of the desired class. * @return <code>Class</code> or null */ public static Class<?> forName(final String className) { try { return Class.forName(className); } catch (final ClassNotFoundException e) { return null; } } }