- Java: How can I covert a String to/from an enum?
Java: How can I covert a String to/from an enum?
String to enum:
MyEnum e = MyEnum.valueOf(mystr);
enum to String:
String str = e.toString();
Copyright © 2008-2021, dave. Code samples on Dave's Brain is licensed under the
Creative Commons Attribution 2.5 License.
other material, including English text has all rights reserved.