Here you can find the source of forName(String name)
public static Class<?> forName(String name) throws ClassNotFoundException
//package com.java2s; //License from project: LGPL public class Main { public static Class<?> forName(String name) throws ClassNotFoundException { switch (name) { case "byte": return byte.class; case "short": return short.class; case "int": return int.class; case "long": return long.class; case "float": return float.class; case "double": return double.class; case "boolean": return boolean.class; case "char": return char.class; default://from w ww . j a va 2 s . co m return Class.forName(name); } } }