📜  java 从字符串中获取枚举 - Java 代码示例

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

代码示例1
public enum Hello {
  A, B, C
};

val = Hello.valueOf("A") // Case sensitive and cannot have spaces in the string
val.equals(Hello.A) // returns true