Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { private static Class<?> getRealClass(Object o) { Class<?> clazz = null; if (o instanceof Integer) { clazz = Integer.TYPE; } else if (o instanceof Float) { clazz = Float.TYPE; } else { clazz = o.getClass(); } return clazz; } }