問題:
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). 在C#中,我們有Type.FullName
和Type.Name
來獲取一個類型的名稱(在本例中是類),有或沒有命名空間(java-world中的包)。
What is the java equivalent to Type.Name
? 什麼是Java等同於Type.Name
?
Clearly there must be a better way than using Class.getName()
and strip it of the package name manually. 顯然,必須有一種比使用Class.getName()
更好的方法,並手動剝離包名稱。
解決方案:
參考一: https://en.stackoom.com/question/BHsT參考二: https://stackoom.com/question/BHsT