• Post Reply Bookmark Topic Watch Topic
  • New Topic

Collection, Collections and Collections Framework?  RSS feed

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between Collection, Collections and Collections Framework?

What is the role of Maps in them?

Pankaj Shinde
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun Java Tutorial has a section on Collections which should answer your questions.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
His brain is the size of a cherry pit! About the size of this ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!