map传值


/**
 * File Name:TestL.java
 * Package Name:job
 * Date:2016年12月16日上午10:35:20
 *
 */

package job;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import scala.actors.threadpool.Arrays;

/**
 * ClassName:TestL
 *
 * @author chenyaobang
 * @version
 * @since JDK 1.6
 * @see
 */
public class TestListMap {

    public static String string = "";
    public static void main(String[] args) {
        Map> map = new HashMap>();
        Map map1 = new HashMap();
        String[] string = new String[] { "1","2","3","4" };
        map1.put("1", string);
        map.put("111", map1);
        ArrayList>> list = new ArrayList>>();
        list.add(map);
        for(int i = 0 ; i
            Map> map2=list.get(i);
            System.out.println(list.get(i));
            //entry遍历
            for (Entry> en : map2.entrySet()) {
                System.out.println(en.getKey());
                System.out.println(Arrays.toString((String[])en.getValue().get("1")));
                for(int j  = 0 ; j < en.getValue().get("1").length;j++){
                    System.out.println(""+en.getValue().get("1")[j]+"");
                }
            }
        }

    }

    public static void get(String str)throws Exception{
        String a =  "";

    }
}

你可能感兴趣的:(java,list,遍历,map)