title: How to make an efficient hashCode?
body: <p>I have three hashCode methods as follows, I prioritised them based on their efficiency. I am wondering if there is any other way to make a more efficient hashCode method.</p>
  
  <pre><code>1) public int hashCode() { //terrible
       return 5; 
     }
  2) public int hashCode() { //a bit less terrible
       return name.length; 
     }
  3) public int hashCode() { //better
       final int prime = 31;
       int result = 1;
       result = prime * result + ((name == null) ? 0 : name.hashCode());
       return result;
     }
  </code></pre>