📅  最后修改于: 2020-11-14 06:18:43             🧑  作者: Mango
java.util.LinkedHashSet类是Set接口的Hash表和Linked list实现,具有可预测的迭代顺序。以下是有关LinkedHashSet的要点-
此类提供所有可选的Set操作,并允许空元素。
以下是java.util.LinkedHashSet类的声明-
public class LinkedHashSet
extends HashSet
implements Set, Cloneable, Serializable
以下是java.util.LinkedHashSet类的参数-
E-这是此集合维护的元素的类型。
Sr.No. | Constructor & Description |
---|---|
1 |
LinkedHashSet() This constructs a new, empty linked hash set with the default initial capacity (16) and load factor (0.75). |
2 |
LinkedHashSet(Collection extends E> c) This constructs a new linked hash set with the same elements as the specified collection. |
3 |
LinkedHashSet(int initialCapacity) This constructs a new, empty linked hash set with the specified initial capacity and the default load factor (0.75). |
4 |
LinkedHashSet(int initialCapacity, float loadFactor) This constructs a new, empty linked hash set with the specified initial capacity and load factor. |
此类从以下类继承方法-