title: is it incorrect to define an hashcode of an object as the sum, multiplication, whatever, of all class variables hashcodes?
body: <p>Let's say I have the following class:</p>
  
  <pre><code>class ABC {
      private int myInt = 1;
      private double myDouble = 2;
      private String myString = "123";
      private SomeRandomClass1 myRandomClass1 = new ...
      private SomeRandomClass2 myRandomClass2 = new ...
  
      //pseudo code
      public int myHashCode() {
          return 37 *
                 myInt.hashcode() *
                 myDouble.hashCode() *
                 ... *
                 myRandomClass.hashcode()
      }
  }
  </code></pre>
  
  <p>Would this be a correct implementation of hashCode? This is not how I usually do it(I tend to follow Effective Java's guide-lines) but I always have the temptation to just do something like the above code.</p>
  
  <p>Thanks</p>