Dumb question: Hashtable sizes

Okay, here's a dumb one.

I notice in the Jigsaw code that when you're getting ready to initialize a
resource, or call indexer.createResource(), you initialize a Hashtable with
an explicit initial size.  But where does this size come from?  It would
make sense to me if you declared a Hashtable of size 10 and then put 10
things in it, but you always seem to specifically declare a Hashtable that
is at least twice as many slots as you need.  Does it have to do with
inherited attributes, or is it some optimal function of the number of
things you're putting in?



+---------------------+-------------------------+---------------------+
|    Dave Makower     |    davemak@pencom.com   |   WWW Specialist    |
+---------------------+-------------------------+---------------------+
|     Co-author of "Java Programming Basics" (Henry Holt/MIS:Press)   |
|                 http://www.pencom.com/javabasics/                   |
+----------------------------------+----------------------------------+
|   Pencom Web Works               |   (212) 513-7777   voice         |
|   Pencom Systems Inc.            |   (212) 513-1975   fax           |
|   40 Fulton St.                  |                                  |
|   New York, NY  10038            |   http://www.pencom.com/         |
+----------------------------------+----------------------------------+

Received on Tuesday, 17 September 1996 14:33:01 UTC