• Post Reply Bookmark Topic Watch Topic
  • New Topic

collection frame work  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
why map interface doesnt come under collection interface like List and set.why map interface included in collection framework. what could be the reason? can any one clarify this ?and also suggest me the realtime application where it(Map) is used.i am learning core java...waiting for your reply

venu
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quote:
"Map and SortedMap, do not extend Collection, as they represent mappings rather than true collections."

http://java.sun.com/j2se/1.4.2/docs/guide/collections/overview.html
 
mandavavenu babu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply,
but where is map interfaces used in real java applications..please clarify
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I sometimes use it when retrieving DB data.
A primary key can make a nice key in a map.

DB : user_id(PK), name, address
Map : user_id -> (name, address)
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mandavavenu babu:
thanks for your reply,
but where is map interfaces used in real java applications..please clarify


Here's a tip. It will not show how a type is used in "real Java applications", but it will show you where it is used in other parts of the API, which is insightful as well. Go the the API page for Map:

http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html

On the top line of that page are links: overview, package, class, use, tree, deprectated, index and help. Click on "use" and you will be taken to a page that shows how Map is used in the API: what packages use it, what specific classes use it, what Map fields are accessible to you, what methods take or return Maps, what classes implement Map, and so on. Does that help?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!