Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}