mardi 17 décembre 2019

Creating enum at runtime using list of String values [duplicate]

This question already has an answer here:

i have a list of values some thing like [Red, Green, Blue]. i get this list during start of the application. Now i want to create enum of Color with members of that list. How to create this enum at runtime in java?

the expected enum should be somewhat like this

public enum Color{
   Red,
   Blue,
   Green
}




Aucun commentaire:

Enregistrer un commentaire