Java tutorial
//package com.java2s; public class Main { /** * Clean-up the class name * * @param o * @return */ private static String getClassName(Object o) { String className = o.getClass().getName(); int pos = className.indexOf('$'); if (pos != -1) { className = className.substring(0, pos); } return className; } }