Here you can find the source of classname(Class javaClass)
public static String classname(Class javaClass)
//package com.java2s; //License from project: Open Source License public class Main { public static String classname(Class javaClass) { String jClassName = javaClass.getName(); return classname(jClassName); }//from w w w . ja v a2 s . c om public static String classname(String jClassName) { int lastDotPos = jClassName.lastIndexOf("."); return jClassName.substring(lastDotPos + 1, jClassName.length()); } }