Multiple choice

Which of the following is the correct syntax of put() method of Map interface in Java?

  1. public Object put(Object key, Map map)

  2. public Object put(Object key, Object value)

  3. public void put(Map map)

  4. public void put(Object key, Object value)

  5. none of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct syntax of put() method of Map interface in java.