public override bool Equals(object obj) { BitArray64 bitArray = obj as BitArray64; if (bitArray == null) { return(false); } return(object.Equals(this.number, bitArray.number)); }
static void Main() { BitArray64 bitsHolder = new BitArray64(); foreach (ulong bit in bitsHolder) { Console.WriteLine(bit); } BitArray64 secondBitsHolder = new BitArray64(); Console.WriteLine(bitsHolder.Equals(secondBitsHolder)); bitsHolder[0] = 10; Console.WriteLine(bitsHolder == secondBitsHolder); }
static void Main(string[] args) { BitArray64 array = new BitArray64(48584939); BitArray64 array2 = new BitArray64(48584932); int[] bits = array.NumberBits; Console.WriteLine("array != array2 -> " + (array != array2)); Console.WriteLine("array == array2 -> " + (array == array2)); Console.WriteLine("array equals array2 -> " + array.Equals(array2)); Console.WriteLine("Fifth bit: " + array[4]); foreach (var bit in bits) { Console.Write(bit); } }
public static bool operator !=(BitArray64 firstStudent, BitArray64 secondStudent) { return(!BitArray64.Equals(firstStudent, secondStudent)); }
public static bool operator !=(BitArray64 array, BitArray64 array2) { return(!BitArray64.Equals(array, array2)); }