Java tutorial
//package com.java2s; public class Main { public static String getClassName(Class<?> klass) { if (klass == null) { return null; } String className = klass.getName(); if (className == null) { return null; } final int splitIndex = className.lastIndexOf('.'); return className.substring(splitIndex + 1); } }