Java Map Print printMap(Map map)

Here you can find the source of printMap(Map map)

Description

print Map

License

Open Source License

Declaration

public static <K, V> void printMap(Map<K, V> map) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Map;

public class Main {
    public static <K, V> void printMap(Map<K, V> map) {
        if (map == null) {
            System.out.println("NULL");
            return;
        }/*ww w .j  a va 2  s.  c om*/

        if (map.size() == 0) {
            System.out.println("EMPTY");
            return;
        }

        for (Map.Entry<K, V> entry : map.entrySet()) {
            System.out.println(entry.getKey() + " = " + entry.getValue());
        }
    }
}

Related

  1. printMap(Map map)
  2. printMap(Map mp)
  3. printMap(Map theMap)
  4. printMap(Map mp)
  5. printMap(Map map)
  6. printMap(Map map)
  7. printMap(Map map)
  8. printMap(Map map)
  9. printMap(Map map)