Java List.add() and Map.put() -


working lists , maps, started thinking, why map method adding object called put , list add?

it developers will, or there under naming methods different.

may methods names let developer know while adding map/list kind of data structure working with? or names describes way works?

the difference :

  1. .add() means insert @ end or wherever want to(you know add) whereas
  2. .put() means add element wherever needs placed, not @ end of map, because depends on key inserted (you don't know add).

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -