Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-12-2007, 08:02 PM
Member
 
Join Date: Oct 2007
Posts: 9
jhetfield18 is on a distinguished road
HashMap visual example
Hi I'm obligated to use the hashmap class to implement a backgammon game and I have the following given code:
public Map<PointType,List<Color>> getPoints();
It's given in Map but we're supposed to use a HashMap:P
Can anyone explain or describe how a Map or a Hashmap is virtually.
e.g.
a hashtable can be described as non-sequent places in memory that contain certain data allocated with the help of a hash function.I simply can't get it as a picture in my head at least after reading the API.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-12-2007, 09:45 PM
Senior Member
 
Join Date: Nov 2007
Location: Newport, WA
Posts: 141
staykovmarin is on a distinguished road
Well imagine an array with methods, without fixed size however, it expands as you add elements to it.

With a HashMap you can add as many items as you want, and each item has its own key. So you add them in pairs, using the put() method. Then when you invoke the get method, you add a key as an argument, and it will return whatever value is associated with that key.

This post really doesnt belong here, in my humble opinion.

Last edited by staykovmarin : 12-12-2007 at 09:47 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hashmap dirtycash New To Java 5 12-03-2007 04:58 AM
DB Visual ARCHITECT 4.1 sp1 JavaBean Java Announcements 0 10-16-2007 08:50 PM
DB Visual ARCHITECT 4.1 levent Java Announcements 0 08-04-2007 09:48 PM
what is hashmap gabriel New To Java 5 08-03-2007 03:23 PM
Help with HashMap in java toby New To Java 1 07-25-2007 10:04 PM


All times are GMT +3. The time now is 10:48 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org