Q: Hash map with 2 values java I need a HashMap some thing which looks like
            Map<String, int,ArrayList<String>> table = new HashMap<String, int,ArrayList<String>>( );

But HashMap accepts only one mapped value.
I tried to implement this with some wrapped class which looks like
     class Wrapper {
          int id;
          ArrayList<String> list = new ArrayList<String>();

          //Here get and set methods 
    }

And then my HashMap looks like
     Map<String, Wrapper> table = new HashMap<String, Wrapper>( );

What I need is:
When I specified int value to my HaspMap then I should be able to retrive ArrayList of that int value.
How can I do that?

A: First of all, HashMap<K,V> implements Map<K,V>, which specifies:

An object that maps keys to values. A map cannot contain duplicate keys; each key can map to at most one value.

So you can't truly have "two" values, no matter how you slice it.
However, it seems like you don't want two values, but two keys. When you specify a String and an int, you expect an ArrayList in return. If this is the case, Sachin's suggestion of Map<String, HashMap<Integer,ArrayList<String>>> will do the job. You could also make a class that more nicely deals with having a nested map:
public class NestedHashMap2<K, L, V> extends HashMap<K, HashMap<L,V>> {

    public V put(K k, L l, V v){
        if(! containsKey(k)){
            put(k, new HashMap<L,V>());
        }
        return get(k).put(l, v);
    }

    public V get(K k, L l){
        if(! containsKey(k)) return null;
        return get(k).get(l);
    }

    //Expand as needed
}

And then you could use it for your example:
NestedHashMap2<String,Integer,ArrayList<String>> m = new NestedHashMap2<>();
ArrayList<String> a = new ArrayList<String>();
a.add("Element");
m.put("First",2,a);
ArrayList<String> a2 = m.get("First",2); //--> a2 = a

