Export (0) Print
Expand All

false Operator (C# Reference)

Returns the bool value true to indicate false and returns false otherwise. This is useful for types that represent true, false, and null, neither true nor false, as used in databases.

Such types can be used for the controlling expression in if, do, while, and for statements and in conditional expressions.

If a type defines operator false, it must also define operator true.

A type cannot directly overload the conditional logical operators && and ||, but an equivalent effect can be achieved by overloading the regular logical operators and operators true and false.

For more information, see the following sections in the C# Language Specification:

  • 10.9.1 Unary operators

  • 7.11.2 User-defined conditional logical operators

  • 7.16 Boolean expressions

Community Additions

ADD
Show:
© 2014 Microsoft