wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Methods  from collections framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Methods  from collections framework" Watch "Methods  from collections framework" New topic
Author

Methods from collections framework

aishwarya mathur
Greenhorn

Joined: Sep 03, 2004
Posts: 22
Hi All,

Do we need to memorize the methods provided in the interfaces and concrete classes from the collections framework for SCJP certification.
Louie van Bommel
Ranch Hand

Joined: Aug 17, 2004
Posts: 76
Nope.

That's the short answer.

Here's the exam objective:
Collections (Exam Objective 9.1) Make appropriate selection of collection classes/interfaces to suit specific behavior requirements.

To achieve this objective, it may be useful to experiment with the methods specified in Collection interface especially add, remove, iterator. Especially iterator I wouldn't dare write the exam without coding an example of add or iterator.

Instead of memorizing method signatures, spend lots of time knowing the names of the interfaces (Collection is also an interface) and their basic feature or two:

Set, List, Map, SortedSet, SortedMap

then learn what is the most basic concrete classes that implement them:
HashSet, ArrayList, HashMap, TreeSet, and TreeMap respectively.

Learn what basic features distinguish all important concrete classes (including the 5 above) in the Collections framework with regards to sorting, specifying an order, adding unique elements, and using keys. Just a note or two on each class will do:

ArrayList: simplest List implementation. Like a Vector but Vector methods are synchronized, ArrayList methods aren't.
TreeSet: a set that's sorted.
... (the other 8 is an exercise for the reader)

It's useful to recognize (but not memorize the signatures of) the names of useful methods of the Collection interface: add, remove, size, contains, and iterator.

If someone tells you the name of a class or interface, you should be able to specify if it is a class or interface, if it has unique elements, if it uses keys, if it is sorted, or is ordered. If you know that much, you are doing well.
aishwarya mathur
Greenhorn

Joined: Sep 03, 2004
Posts: 22
Thanks Louie, that was very helpful ....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Methods from collections framework