This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help me to solve my problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help me to solve my problem" Watch "Help me to solve my problem" New topic
Author

Help me to solve my problem

Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
Hi,

I am learning Collections in Java. I want the example and explanationfor all the collections such as
Set - LinkedHashSet, HashSet (SortedSet - Treeset)
List - ArrayList, LinkedList and Vector
Map - HashMap, LinkedHashMap, HashTable (SortedMap - TreeMap)

Please provide me with some good tutorial for beginners to learn collections other than the Sun's tutorial.

ArrayList, Vector, LinkedList: I Know these concepts and have a general idea about what it is.

But I always struck with Hash table concepts. Also If you know any tutorial for beginners to easily understand the concepts of hash table will be helpful.
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

Head First Java, by Bert Bates and Kathy Sierra
Thinking in Java (Free online), by Bruce Eckel
Hentay Duke
Ranch Hand

Joined: Oct 27, 2004
Posts: 198
www.google.com
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

http://java.sun.com/docs/books/tutorial/collections/


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Chapter 11: "Collections of Objects" from Bruce Eckel's Thinking in Java...

http://www.faqs.org/docs/think_java/TIJ313.htm


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
To understand hash tables you must understand the purpose and nature of hash functions. It's all about reducing a string to a single numeric value. If you then use that value to identify a storage location, you can lookup an element without a search: compute the hash value, that's your location.

It's slightly more complicated than that. Duplicate values are frequently generated and hash functions are not limited to strings by any means. But, generally speaking that's all you need to know.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Here's my analogy for lookups using hashCode...

Imagine a library with numerous rows of bookshelves. If you're looking for a particular book, it would be a lot faster if you knew what particular row of shelves to look in, rather than searching through the entire library. Of course, when you've found the correct shelves (indicated by hashCode), there might be other books on those shelves (because different objects might return the same hashCode), but you've narrowed your search to a much smaller region.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me to solve my problem
 
Similar Threads
Difference between ArrayList, LinkedList and Vector
collections
Data Structures Differneces(Array,Arraylist,Vector and Linkelist)
Collections
String Pool.....?