Difference between a HashMap and a dictionary ADT

前端 未结 4 1279
一整个雨季
一整个雨季 2020-12-04 11:34

What is the difference between a Hash Map and dictionary ADT. And when to prefer one over another. For my programming assignment my instructor has asked to use one of them b

4条回答
  •  眼角桃花
    2020-12-04 11:52

    In Java the HashMap implements the Map interface while the Dictionary does not. That makes the Dictionary obsolete (according to the API docs). That is, they both do a similar function so you are right that they seem very similar...a HashMap is a type of dictionary.

    You are advised to use the HashMap though.

提交回复
热议问题