Online Java Compiler By
JavaTpoint.com
import java.util.IdentityHashMap; import java.util.Set; public class IdentityHashMapEntrySetExample1 { public static void main(String[] args) { //Creating an object of IdentityHashMap class IdentityHashMap
map = new IdentityHashMap
(6); //Putting key-value pairs inside map map.put("Java", 1); map.put("is", 2); map.put("the", 3); map.put("best", 4); map.put("programming", 5); map.put("language", 6); //Creating a Set Set set = map.entrySet(); //Displaying all entries in Set System.out.println(set); } }
Output