Well the one I think I'm weakest on is the Collections as far as what does what. Page 545 of the book has an excellent table however when I read through "what does what" and even try to apply it I can never seem to pick the right one.
HashMap, Hashtable, TreeMap, LinkedHashMap, HashSet, TreeSet, LinkedHashSet, ArrayList, Vector, LinkedList, PriorityQueue are in the list of items for the
test.
Queue and LinkedList I think I'm somewhat familiar with. Most testing seems to ask about the LinkedList allowing the Queue interface for offer() and poll(). I'm good with that.
I understand Vector is the thread-safe version of arraylist. I understand Key/Value pairs in the Maps. Sets are unique. This all makes sense to me.
Where I ran into trobule today was with 2 specific questions that smoked me:
Q1: Which collection class ofers constant-time performance for the basic operations add() remove() contains() and size().
<answer omitted>
and
Q2: You have a hashmap whos keys need to be retreived in a sorted manner. Which of the following will help you achive this?
Copy the contents of the hashmap into a treemap
or
add the keys of the hashmap to a treeset.
--
Q1 just smoked me. I spaced completely
Q2 however I got 1 of 2 correct. The second one I just couldnt understand how a map got into a treeset since maps are k/v based. So to not see the answer there eludes me since I'm not sure how to do it. The treemap I thought was kind of a gimmie since it obviously was a sort map. (rememberign that both treemap and treeset are sorted).
(some of this IS sticking)