1

Let's suppose my Java program has 3 types of custom designed objects (entities, relationships, rulesets). If I need to build a collection of at least 1, but up to 3 of the types, each with a size of 0 to n, what is the best way to do so? Is the set class the right thing to use? Can the Collection class be used? How would I define such a 'set' or 'collection' in Java?

WildBill
  • 9,143
  • 15
  • 63
  • 87

1 Answers1

1

This flow chart, as created by @TimB, is a great tool for determining the right collection based on particular requirements.

enter image description here

Community
  • 1
  • 1
aliteralmind
  • 19,847
  • 17
  • 77
  • 108