Advertisement
absorr

Lesson 46

Feb 4th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. //QUESTION 1
  2. // A List keeps things stored by an index, while a Set stores things by either hash codes or a tree structure or however the program wants to do so.
  3.  
  4. //QUESTION 2
  5. // One may either retrieve an array or iterator that will allow you to loop through them as normal.
  6.  
  7. //QUESTION 3
  8. // One would cast them to an Integer before using s.add(Integer).
  9.  
  10. //QUESTION 4
  11. // HashSet and TreeSet
  12.  
  13. //QUESTION 5
  14. s.iterator();
  15.  
  16. //QUESTION 6
  17. // hasNext(), next(), remove()
  18.  
  19. //QUESTION 7
  20. // A Set object has built-in algorithms that make them faster.
  21.  
  22. //QUESTION 8
  23. // isEmpty(), size() == 0, or clear()
  24.  
  25. //QUESTION 9
  26. // 6
  27.  
  28. //QUESTION 10
  29. s.removeAll(s);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement