Here you can find the source of getClassName()
public static String getClassName()
//package com.java2s; //License from project: Open Source License public class Main { public static String getClassName() { return new Exception().getStackTrace()[0].getClassName(); }//from ww w . j a v a 2 s. c om }