What to do ?
Action plan:
- Get all values from enum and put them to array
MyEnums
.values()
- Convert them to ArrayList
new ArrayList<
MyEnums
>(Arrays.asList(
MyEnums
.values()
));
Problem require 1 line of code, so go prepare coffee and enjoy reading:
ArrayList<
MyEnums
> enumlist = new ArrayList<
MyEnums
>(Arrays.asList(
MyEnums
.values()
));
Simple :)
No comments:
Post a Comment