• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Collection doubt

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I came a/c the following code while giving mock exams

Do we need to study api(I mean methods) of all collection classes for the purpose of the exam?
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Veena -
I'm not sure I understand how your code listing applies to your question, sorry. But I can tell you this much:
For collections you need to understand the purposes and features of these:
Collection, Map, Sorted Map, Set, Sorted Set, List
And you need to understand the purposes and features of these:
HashSet, LinkedHashSet, TreeSet, LinkedList, Vector, ArrayList, Hashtable, LinkedHashMap, HashMap, TreeMap.
You also need to understand how iterators work.
You don't need to know all the methods, it's really about why would you use one vs. another. Which ones allow dups, which ones are ordered...
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bert.
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to add to what Bert said ...
You must be clear about the purpose of the classes and interfaces. Suppose, for instance, you are looking at LinkedList and ArrayList: which would be more suitable if:
1. You are mainly adding elements to the end of the list
2. You are mainly adding elements not to the end of the list
3. You are mainly retrieving elements by using an index
4. You are mainly deleting elements from the list
5. You need to implement a FIFO queue
6. You need to implement a pushdown stack
7. You need to implement an LRU cache
8. You need to implement a map
9. You need to implement a set
[ September 14, 2003: Message edited by: Roger Chung-Wee ]
 
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bert,
Can we also assume that exam expects you to know Collection good enough you can read and understand code littered with collections easily. So that you can answer other questions testing some other skills.
Just like anonymous classes. As you book says that exam is littered with code involving these classes while testing knowledge some other area.
Thanks
Barkat
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic