0

I am looking to create an arraylist, with a hashmap in each value. Not sure how to even start this? Anybody have some old code, or can help out?

1
  • 3
    what language are you looking for? java? Commented Dec 3, 2015 at 3:13

2 Answers 2

1

In Java

ArrayList<Map<Integer, String>> list = new Arraylist<>();
list.add(new HashMap<Integer, String>());
list.get(0).put(1, "Value");
Sign up to request clarification or add additional context in comments.

Comments

0

With generic in Java:

ArrayList<HashMap<Integer,String>> david = new ArrayList<HashMap<Integer,String>>();
david.add(new HashMap<Integer,String>());

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.