title: In Java HashSet, how it calculate hashCode for custom object?
body: <p><strong>If we do not override the hashCode(), how it calculate hashCode for custom object by default?</strong><br>
  <strong>i.e.</strong></p>
  
  <pre><code>class TrieNode {
      Character letter;
      TrieNode parent;
      Map&lt;Character, TrieNode&gt; children;
      boolean isEndOfWord;
      TrieNode(Character letter, TrieNode parent, boolean isEndOfWord) {
          this.letter = letter;
          this.parent = parent;
          this.isEndOfWord = isEndOfWord;
          children = new HashMap&lt;Character, TrieNode&gt;();
      }
  }
  </code></pre>
  
  <p><strong>Usage:</strong><br></p>
  
  <pre><code>Set&lt;TrieNode&gt; set = new HashSet&lt;TrieNode&gt;();
  TrieNode trieNode = new TrieNode('c', parentNode, true);
  set.add(trieNode);
  </code></pre>
  
  <p><hr>
  <strong>Note:</strong><br></p>
  
  <ul>
  <li>If we do not override the "hashCode()".</li>
  </ul>
  
  <p><strong>Clarify Question:</strong><br></p>
  
  <ul>
  <li>By default, how this HashSet calculate the hashCode for this custom
  object?</li>
  <li>Where to find it in the Java doc?</li>
  </ul>
  
  <p><strong>Addition:</strong><br>
  I have tried to find it in the Java doc, but did not get it.<br>
  I have tried to find these places:<br></p>
  
  <ul>
  <li>HashSet.class</li>
  <li>AbstractSet.class</li>
  <li>Object.class</li>
  <li>System.class</li>
  </ul>