Here you can find the source of simpleName(Object obj)
public static String simpleName(Object obj)
//package com.java2s; //License from project: Open Source License public class Main { public static String simpleName(Object obj) { return getClass(obj).getSimpleName(); }//from w ww.j av a 2s .co m public static String simpleName(Class clazz) { return getClass(clazz).getSimpleName(); } public static Class getClass(Class clazz) { while (clazz.isAnonymousClass()) clazz = clazz.getSuperclass(); return clazz; } public static Class getClass(Object obj) { return getClass(obj.getClass()); } }