3 ms·
> As I found out while writing this article, modern JDKs do not allocate any space in a HashSet until something is added. Ah, but the object still exists. If l
by kazinator 7y ago
> As I found out while writing this article, modern JDKs do not allocate any space in a HashSet until something is added.
Ah, but the object still exists. If large space of objects is needed that is sparsely used, the thing to do is to make that space itself lazy, not the individual objects.