Java examples for Reflection:Class Name
get Short Java Name
//package com.java2s; public class Main { public static void main(String[] argv) { Class c = String.class; System.out.println(getShortJavaName(c)); }//w ww. ja v a 2 s . co m public static String getShortJavaName(Class<?> c) { String[] split = c.getName().split("\\."); return split[split.length - 1]; } }