public override bool Equals(object obj) { BitArray64 valueToCheck = obj as BitArray64; if ((object)valueToCheck == null) { return(false); } return(this.BitArray == valueToCheck.BitArray); }
static void Main(string[] args) { BitArray64 first = new BitArray64(255); Console.WriteLine(first); BitArray64 second = new BitArray64(255); Console.WriteLine(second); Console.WriteLine(first.Equals(second)); Console.WriteLine(first != second); Console.WriteLine(); second[60] = 1; Console.WriteLine(second); Console.WriteLine(first.Equals(second)); Console.WriteLine(first == second); Console.WriteLine(first.GetHashCode()); Console.WriteLine(second.GetHashCode()); }