Given:
3. import java.util.*; 4. public class Mixup { 5. public static void main(String[] args) { 6. Object o = new Object(); 7. // insert code here 8. s.add("o"); 9. s.add(o); 10. } 11. }
And these three fragments:
I. Set s = new HashSet(); II. TreeSet s = new TreeSet(); III. LinkedHashSet s = new LinkedHashSet();
When fragments I, II, or III are inserted independently at line 7, which are true?
Choose all that apply.
A, B, C, D, and F are all correct.
Only E is incorrect. Elements of a TreeSet must in some way implement Comparable.