Here you can find the source of simpleClassName(Class> clazz)
public static String simpleClassName(Class<?> clazz)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009 Neil Bartlett.// www .j a v a 2s . c om * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Neil Bartlett - initial API and implementation ******************************************************************************/ public class Main { public static String simpleClassName(Class<?> clazz) { Package pkg = clazz.getPackage(); String result; if (pkg == null) result = clazz.getName(); else result = clazz.getName().substring(pkg.getName().length() + 1); return result; } }