Java tutorial
//package com.java2s; public class Main { private static Class PRIMITIVE_CLASSES[]; @SuppressWarnings("unchecked") public static Class resolvePrimitiveClassName(String name) { if (name.length() <= 8) { for (int i = 0; i < PRIMITIVE_CLASSES.length; i++) { Class clazz = PRIMITIVE_CLASSES[i]; if (clazz.getName().equals(name)) return clazz; } } return null; } }