Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String getClassName() {
        try {
            String fullClassName = new Exception().getStackTrace()[1].getClassName();
            return fullClassName.substring(fullClassName.lastIndexOf(".") + 1);
        } catch (Exception ex) {
            return "UnknownClass";
        }
    }
}