If I need to add an enum attribute to a list, how do I declare the list? Let us say the enum class is:
public enum Country{ USA, CANADA; }
I want to do:
List<String> l = new ArrayList<>();
l.add(Country.USA);
What needs to be used instead of List<String>?
If you want the string type use this:
l.add(Country.USA.name());otherwise the answer of MByD