HashSet vs LinkedHashSet

后端 未结 10 2530
暗喜
暗喜 2020-11-28 18:20

What is the difference between them? I know that

A LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all el

10条回答
  •  一向
    一向 (楼主)
    2020-11-28 18:50

    If you take a look at the constructors called from the LinkedHashSet class you will see that internally it's a LinkedHashMap that is used for backing purpose.

提交回复
热议问题