posted 17 years ago
Hi Ramdas,
A very Good question...
I saw the API,
What i understood:
if you have initial capacity as 100. and load factor set to 0.75,
then if 75 buckets are full, then it will start executing rehash,
which will cause the capacity to be doubled like 200.
rehashing needs some time to re-locate(expand) the Map.
thats why we keep it .75 by default. not to 1.
I didn't get why HashMap, Hashsets have loadfactor why not ArrayList.
Please correct me if i am in a illusion...
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)