HashMap | and LinkedHashMap CIP | Question 8

Last Updated :
Discuss
Comments

What is the output of,

Java
import java.util.*;
class HelloWorld {
    public static void main(String[] args) {
      HashMap<String, Integer> m = new HashMap<String, Integer>();
      m.put("gfg", 10);
      m.put("ide", 16);
      m.put("courses", 25);
      System.out.print(m);
      System.out.print(m.size());
      
      for( Map.Entry< String, Integer >e: m.entrySet())
        System.out.print(e.getKey() + " " + e.getValue());
    }
}



 

3courses 25gfg 10ide 16

Error

{courses=25, gfg=10, ide=16}3courses 25gfg 10ide 16

None of these

Share your thoughts in the comments