package devmanuals.com; import java.util.EnumMap; enum Day // creating an enumeration of Days { Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday; } public class EnumMapDemo { public static void main(String args[]) { EnumMap dayMap=new EnumMap(Day.class); // this statement creates an object of EnumMap dayMap.put(Day.Monday, "Working day"); // It puts the values on the basis of key-value pair dayMap.put(Day.Tuesday, "Working day"); dayMap.put(Day.Wednesday, "Working day"); dayMap.put(Day.Thursday, "Working day"); dayMap.put(Day.Friday, "Working day"); dayMap.put(Day.Saturday, "Relax day"); dayMap.put(Day.Sunday, "Relax day"); for(Day day:Day.values()) // iterate over the day { System.out.println(day+"-----> is "+dayMap.get(day)); // printing the key-value pair } } }