Results 1 to 3 of 3
  1. #1
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default using lists in maps

    Is there a way of using a hashmap to link elements of two identical array lists together. So that the elements of the first list are used as values and then the keys are every other element of that list?

  2. #2
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: using lists in maps

    Also, how do you specify list elements? For example, if you had an array called stuff then stuff[0] would mean the element stored in index zero. How do you specify this for a list?

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,610
    Rep Power
    5

    Default Re: using lists in maps

    Check out the following and their implementations. They try writing some code to see if you understand how they work. Then, if you have problems getting the code to work, ask the forum.

    List (Java Platform SE 7 )
    Map (Java Platform SE 7 )

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. Map contains lists , in this list contains maps again
    By Chandu Allu in forum New To Java
    Replies: 1
    Last Post: 07-16-2012, 03:08 PM
  2. Java collections maps and lists
    By Razorfc in forum New To Java
    Replies: 1
    Last Post: 04-11-2012, 09:14 AM
  3. Converting Lists to Maps
    By Suzanne M in forum Advanced Java
    Replies: 0
    Last Post: 12-24-2011, 02:37 AM
  4. Comparing objects: lists and maps
    By LucasH in forum Advanced Java
    Replies: 7
    Last Post: 05-24-2011, 06:41 PM
  5. Help with Maps
    By snripa in forum New To Java
    Replies: 4
    Last Post: 12-14-2010, 09:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •