package devmanuals.com; import java.util.Map; import java.util.HashMap; public class MapIsEmpty { public static void main(String args[]){ Map mp = new HashMap(); System.out.println("Is map empty ? "+mp.isEmpty()); mp.put(1, "A"); mp.put(2, "B"); mp.put(3, "C"); mp.put(4, "D"); mp.put(5, "E"); boolean bol=mp.isEmpty(); System.out.println("Is map empty ? "+bol); System.out.println("All the mappings are "+mp); System.out.println("Size of map = "+mp.size()); } }