Is there a Java data structure that:
There is LinkedHashSet
, but it only allows remove(object)
, add(object)
as per Set
.
LinkedHashSet will allow removal of the first element, just do
Iterator iter = linkedHashSet.iterator();
if(iter.next()) {
iter.remove();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With