Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { private static String getClassName(Object obj) { String fullPathClassName = obj.getClass().getName(); String className = fullPathClassName.substring(fullPathClassName.lastIndexOf(".") + 1, fullPathClassName.length()); return className; } }