Why is there Apache's Synchronized Set when we have Collection's SynchronizedSet?
Is it better in any way?
It depends on what you want to do. Apache's synchronized set allows you to get the underlying set. It is probably provide for consistency. The Collections method is standard.
You might consider using one of the concurrent sets like Collections.setFromMap(new ConcurrentHashMap()), CopyOnWriteArraySet or ConcurrentSkipListSet
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