0

Suppose I have a json as

{
  "data": {
    "json": [

      {
        "value": [
          "john","joy"
        ],
        "key": "Names"
      },

      {
        "value": [
          "25A",
           "26B"
        ],
        "key": "john"
      },

      {
        "value": [
          "27A",
          "28B"
        ],
        "key": "joy"
      }
    ]
  }
}

I want to do create a Dynamic ArrayList names for each values as shown below

for(String name:Names){
  //create a dynamic arraylist from the names here like 
 // ArrayList<String> joy= ..........
}

Can Anyone help me with this please?

1
  • why down vote ? without commenting anything? Feel pity on some people. Commented Aug 8, 2017 at 4:16

1 Answer 1

1

Maybe use

Map<String, List<String>> map = new HashMap<String, List<String>>();
map.put("arrayname", new ArrayList<String>());
Sign up to request clarification or add additional context in comments.

2 Comments

will try this. Thanks
I want the name to be the name:Names and the number of list will also be the numbers of name ..

Your Answer

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