wood burning stoves
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Collection, Collections and Collections Framework? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Collection, Collections and Collections Framework?" Watch "Collection, Collections and Collections Framework?" New topic

Collection, Collections and Collections Framework?

Pankaja Shinde
Ranch Hand

Joined: Sep 15, 2006
Posts: 87
What is the difference between Collection, Collections and Collections Framework?

What is the role of Maps in them?

Pankaj Shinde
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
The Sun Java Tutorial has a section on Collections which should answer your questions.
Tommaso Nuccio
Ranch Hand

Joined: Dec 11, 2006
Posts: 66
Quick overview

"Collection" is an interface where the interfaces Set, List and Queue extend from. These in turn are implemented by the different classes, e.g. the interface Set by HashSet.

"Collections" is a class that holds all kind of static methods. For example Collections.sort(List<T> list) that will sort a list or its overload Collections.sort(List<T> list, Comparator<? super T> c).

"Map"s are also a collection and thus part of the Collection Framework, but "Map" simply does not extend from "Collection".

The Collection Framework is a help for the programmer to make use of well defined, loose coupled and high cohesive classes and interfaces that have been tested to be "perfect".

This should give you a first overview.
Good luck.

Ciao,<br /> Tommaso<br /> <br />~*~*~*~<br />There are 10 types of people, those who understand binary and those who don't.
I agree. Here's the link: http://aspose.com/file-tools
subject: Collection, Collections and Collections Framework?
jQuery in Action, 3rd edition