Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: key with 2 attributes?

  1. #1
    Join Date
    Feb 2011
    Thanked 0 Times in 0 Posts

    Default key with 2 attributes?

    What I want is something like this:

    Map<String, Double, String>

    Where the first is a key, and the second 2 are attributes of that key. What is the best object for this setup?

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Washington, DC
    My Mood
    Thanked 632 Times in 540 Posts

    Default Re: key with 2 attributes?

    Just define an Object that contains the attributes and use that as the value mapped to the key.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Get CSS Attributes using Java
    By justinmifsud in forum Object Oriented Programming
    Replies: 2
    Last Post: February 15th, 2011, 04:08 PM
  2. javax.print setting attributes
    By prodtechjoshim in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 4th, 2011, 05:54 AM
  3. [SOLVED] font size and other attributes for Graphics.drawString()
    By gib65 in forum AWT / Java Swing
    Replies: 2
    Last Post: October 30th, 2010, 02:31 PM
  4. Cannot access class attributes
    By Cyburg in forum What's Wrong With My Code?
    Replies: 1
    Last Post: August 29th, 2010, 07:30 AM
  5. looping through an ArrayList of objects with their own attributes
    By etidd in forum Java Theory & Questions
    Replies: 2
    Last Post: April 2nd, 2010, 06:15 AM