Untitled

 avatar
unknown
java
2 years ago
397 B
8
Indexable
public class Maps {
    public static void main(String[] args) {
        Map<String, Integer> map1, map2, map3;

        map1 = Map.of(
                "A", 0,
                "D", 1,
                "B", 2,
                "C", 3
        );

        map2 = new LinkedHashMap<>(map1);
        map3 = new TreeMap<>(map1);

        System.out.println(map2);
        System.out.println(map3);
    }
}
Editor is loading...