Equality of Types

In C#, comparison operators check values for value types but memory addresses for reference types.

We'll cover the following...

It is common to compare two variables using comparison operators. The behavior of this operator is different for reference types and value types.

Comparing values

When we check the equality of two value type variables, .NET compares the values of those two variables on the stack and returns true if they are equal.

Step 1: In Program.cs, add statements to declare two integers with equal values and then compare ...