21

how can I convert this to a List of the same object type?

TreeSet<FieldBean> Fields = new TreeSet<FieldBean>();

Thanks

Doc Holiday
  • 9,928
  • 32
  • 98
  • 151

1 Answers1

56

One of the constructors of ArrayList takes a collection as an argument and fills the list with the items contained in that collection:

List<FieldBean> list = new ArrayList<FieldBean> (fields);
assylias
  • 321,522
  • 82
  • 660
  • 783