5 ms·
How is that any different from a list?
by chirau 4y ago
How is that any different from a list?
- Gregam3 4y agoHopefully this java can illustrate the point if you're not a Java lover The bag essentially works like this Map<K, Collection<V>> But looks like this Bag<K, V> I use my own simple "BagSet" which works like this Map<K, Set<V>>
- joshlemer 4y agoTwo lists are equal only if they have the same contents and in the same order. Bags don’t have an order, they’re more like sets, so bags are equal so long as they have the same contents.