bool type aliasing the
type is a logical value that can be assigned
We use the bool type to represent a ture or false value, for example, isRaining, isValid, isChecked.
No conversions can be made from the
bool type to numeric types or vice versa.
!= test for equality and inequality of any type,
but always return a bool
The following code shows how to use the Equality and Comparison Operators.
int x = 1; int y = 2; int z = 1; Console.WriteLine (x == y); // False Console.WriteLine (x == z); // True
For reference types, equality, by default, is based on reference, as opposed to the actual value of the underlying object.