Here you can find the source of classForName(String typeName)
public static Class<?> classForName(String typeName)
//package com.java2s; public class Main { public static Class<?> classForName(String typeName) { if (typeName.equals("boolean")) return boolean.class; if (typeName.equals("byte")) return byte.class; if (typeName.equals("char")) return char.class; if (typeName.equals("short")) return short.class; if (typeName.equals("int")) return int.class; if (typeName.equals("long")) return long.class; if (typeName.equals("float")) return float.class; if (typeName.equals("double")) return double.class; try {// w w w .ja v a 2s . c o m return Class.forName(typeName); } catch (ClassNotFoundException e) { return null; } } }