Why do these two comparisons have different results?
Why does this code return true: new Byte() == new Byte() // returns true but this code returns false: new Byte[0] == new Byte[0] // returns false Because new Byte() creates value type, which are compared by value (by default it will return byte with value 0 ). And new Byte[0] creates array, which is a reference type and compared by reference (and these two instances of array will have different references). See Value Types and Reference Types article for details. Bytes are value types in .NET, meaning that the == operator returns true if and only if the two bytes have the same value. This is