Java tutorial
//package com.java2s; public class Main { private static String getClassNameFromPackageName(String className) { if (className.contains(".")) { String[] classNameArr = className.split("\\."); className = classNameArr[classNameArr.length - 1]; } return className; } }