What is the default behavior of Equals Method?

Let A be a class with some members as x, y, z:

Class A {
  int x;
  int y;
  String z;
  ...
}

A is an Object so it inherits the "Equals" functions defined in Object. What is the default behavior of this function? Does it check for the equality of members or does it check for reference equality?


Solution 1:

The default implementation of Equals supports reference equality for reference types, and bitwise equality for value types. Reference equality means the object references that are compared refer to the same object. Bitwise equality means the objects that are compared have the same binary representation.

http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx

Solution 2:

it checks for reference unless you override equals