中国开发网: 论坛: 程序员情感CBD: 贴子 429778
dead_lee: 文档看看
valueOf
public static <T extends Enum<T>> T valueOf(Class<T> enumType,
String name)Returns the enum constant of the specified enum type with the specified name. The name must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
enumType - the Class object of the enum type from which to return a constant
name - the name of the constant to return
Returns:
the enum constant of the specified enum type with the specified name
Throws:
IllegalArgumentException - if the specified enum type has no constant with the specified name, or the specified class object does not represent an enum type
NullPointerException - if enumType or name is null

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录