Java: can I do HashMap<String, String, String, String>? if not what class can I use to store key, value1, value2, value3....?

Posted on 2012-08-14
Last Modified: 2012-08-14
Hello Experts,

I just tried to do this:

HashMap<String, String, String, String> hmap = new HashMap<String, String, String, String>();

but it didn't work....
what class can I use to store key, value1, value2, value3, value4....?

any suggestions are greatly appreciated...

Question by:epifanio67
    LVL 86

    Accepted Solution

    You're probably best off with

    Map<String, List<String>>

    Open in new window

    unless the various values should really be modelled as the instance of a class

    Author Closing Comment

    thank you Expert....

    I appreciate the help...

    LVL 86

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now