Here you can find the source of getClass(String className)
public static Class<?> getClass(String className) throws ClassNotFoundException
//package com.java2s; /*/* w w w .jav a 2 s . co m*/ * %W% %E% * * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.util.*; public class Main { private static final Map<String, Class<?>> primitiveMap = new HashMap<String, Class<?>>(); /** * This method returns the class matching the name className. * It's used to cater for the primitive types. */ public static Class<?> getClass(String className) throws ClassNotFoundException { Class<?> c; if ((c = primitiveMap.get(className)) != null) return c; return Class.forName(className); } }