Recent minor changes to alt.design triggered by comments from John Austin. In particular, John drew my attention to HashMap initialization. I naively assumed that providing an initial size to a HashMap would take account of the default load factor. Re-reading the documentation, I came to the conclusion (with John) that this was not the case. That is, creating a hash with
hm = new HashMap(20);
then adding 20 items to it, will force a rehash after 75% of the items have been added. Silly as it seems, that appears to be the way of it. Does anyone else have any experience of this?


Peter
--
Peter B. West <http://www.powerup.com.au/~pbwest/resume.html>



Reply via email to