I am using LinkedHashMap
. I will always process the first value and that can be deleted (if possible) so that during the next iteration I will again take the same first value from the map to process. What can I use to get the first value.
You can use this to get the first element key:
Object key = linkedHashMap.keySet().iterator().next();
then to get the value:
Object value = linkedHashMap.get(key);
and finally to remove that entry:
linkedHashMap.remove(key);
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