Hello All,
As per
http://java.sun.com/j2se/1.4.2/docs/api/java/util/LinkedHashSet.html the default initial capacity of a LinkedHashSet is 16. So, if I construct a new LinkedHashSet as below...
LinkedHashSet lhset = new LinkedHashSet();
The default capacity of lhset will be 16. I tried adding 20 elements in lhset. All the elements were added without any problem.
Q. Does this mean the collections increase their size automatically?
Q. size and capacity are two different parameters of any collection. After adding 20 elements, i got lhset.size() == 20. How do I find the "capacity" of lhset?
Regards,
Rekha