📜  java enum to string - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:35.213000             🧑  作者: Mango

代码示例1
public enum MyEnum{
    SOMETHING,SOMETHING_ELSE
}
MyEnum enumObject=MyEnum.SOMETHING;
System.out.println(enumObject.toString());
System.out.println(enumObject.name());