Go into your
Java installation file, and explore it until you find a file called src.zip. Unzip that file, go into the "java" then the "util" folders and find "HashSet.java." Open it. You will find that HashSet uses a HashMap, so you open HashMap, and there you find that HashMap uses an array of Entries. I haven't read it properly, but shall leave that to you. It appears to double its capacity whenever the array is more than 75% full, and to create a new Entry[] array whenever its capacity changes/