• Post Reply Bookmark Topic Watch Topic
  • New Topic

many doubts in Collections...?  RSS feed

 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Except for WeakHashMap, are unused keys in HashMap and TreeMap also garbage-collected ?

What's "fillratio" in HashMap(int capacity, float fillratio) ?......how can we use it in our programs...any example program ??....PLEASE!!!

As per their functionality and use in program how do Set and Map differ?.....for e.g we have TreeSet - TreeMap, HashSet-HashMap....!

How to decide appropriate use of the collection frameworks classes and interfaces in our programs ?...i mean for e.g......where would use of Tree be most correct-in which category of Programs....where would use of Set or list be more appropriate....?...Or when is it best to use Vector ?...any examples Please ?

this is because i want to decide appropriate use of collection framework to write efficient programs .
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by unused keys ?

The rest of your questions are answered in the API docs. The description for each of the individual Collections classes describe their use.

The Collections tutorial will probably be a useful read as well.
[ September 23, 2005: Message edited by: Joanne Neal ]
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have been refering API doc from a longtime....not that helpful!.....thats why i ask my doubts here !!!...API docs give very vague idea i want to know how and why of things in java!...API doc won't give me that!
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the description of the loadFactor variable (what you refer to as the fillration) and what a Set and Map are in the API docs, are pretty good. What exactly don't you understand ?
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While I agree with Joanne that the API docs are a great reference, they are meant as a reference, not a tutorial. That is why Sun created the Java Tutorial. I strongly suggest that you read the section (or Trail, as it is called) about Collections. It will help you understand the differences between Map and Set as well as all the other interfaces available in the Collections API.

I hope this helps.

Layne
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!