What is the difference between Lists, ArrayLists, Maps, Hashmaps, Collections etc..?

后端 未结 10 1748
-上瘾入骨i
-上瘾入骨i 2021-01-30 01:38

I\'ve been using HashMaps since I started programming again in Java without really understanding these Collections thing.

Honestly I am not really sure if using HashMaps

10条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 02:17

    In Brief (and only looking at interfaces):

    List - a list of values, something like a "resizable array"

    Set - a container that does not allow duplicates

    Map - a collection of key/value pairs

提交回复
热议问题