Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Methods from collections framework

 
aishwarya mathur
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Louie, that was very helpful ....
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic