package com.lovecoding.day20.map01;

import org.junit.Test;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class TestMap01 {

    @Test
    public void test01(){
        //Map
        LinkedHashMap<Integer,String> map = new LinkedHashMap<>();

        map.put(1,"a");
        map.put(3,"b");
        map.put(2,"c");
        map.put(4,"d");

        Set<Map.Entry<Integer, String>> entries = map.entrySet();

        for (Map.Entry<Integer, String> entry : entries) {
            System.out.println( entry.getKey() + "- " + entry.getValue() );
        }

    }

}
