true, false C# with Example
The true and false keywords have two uses: 1. As literal Boolean values var myTrueBool = true; var myFalseBool = false; 2. As operators that can be overloaded public static bool operator true(MyClass x) { return x.value >= 0; } public static bool operator false(MyClass x) { return x.value < 0; } Overloading the false operator was useful prior to C# 2.0, before the introduction of Nullable types. A type that overloads the true operator, must also overload the false operator.