public class HashSet<E> extends AbstractSet<E> implements Set<E>
| Constructor and Description |
|---|
HashSet() |
HashSet(Collection<? extends E> collection) |
HashSet(int capacity) |
HashSet(int capacity,
float loadFactor) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E object) |
void |
clear() |
boolean |
contains(Object object) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object object) |
int |
size() |
equals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringaddAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArrayremoveIfpublic HashSet()
public HashSet(int capacity)
public HashSet(int capacity,
float loadFactor)
public HashSet(Collection<? extends E> collection)
public boolean add(E object)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>public boolean contains(Object object)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public boolean remove(Object object)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>Copyright © 2026. All rights reserved.