Java tutorial
//package com.java2s; //License from project: Apache License public class Main { /** * Get just the class name from a fully qualified class * * @param clazz Class * @return String name of the class without its package */ private static String getClassName(Class<?> clazz) { int beginIndex = clazz.getName().lastIndexOf(".") + 1; return clazz.getName().substring(beginIndex); } }