Previous Topic: CompareTo Method—Compares Two ObjectsNext Topic: Arguments


Purpose

Compares two objects and returns a negative if the first instance is less than the second; a positive if the first instance is greater than the second; 0 if the two instances are equal.

For comparison purposes, nulls are considered equal and a null compared to a non-null is always less than the non-null value.