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 :
- .add() means insert @ end or wherever want to(you know add) whereas
- .put() means add element wherever needs placed, not @ end of map, because depends on key inserted (you don't know add).
Comments
Post a Comment