File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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: 42959
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:
subject: Collection, Collections and Collections Framework?
It's not a secret anymore!