How to get the name of a class without the package?

后端 未结 3 563
余生分开走
余生分开走 2020-12-12 14:23

In C# we have Type.FullName and Type.Name for getting the name of a type (class in this case) with or without the namespace (package in java-world)

3条回答
  •  遥遥无期
    2020-12-12 14:37

    The following function will work in JDK version 1.5 and above.

    public String getSimpleName()
    

提交回复
热议问题