Boolean.Compare(Boolean, Boolean) Method

Definition

Compares two boolean values.

[Android.Runtime.Register("compare", "(ZZ)I", "")]
public static int Compare (bool x, bool y);
[<Android.Runtime.Register("compare", "(ZZ)I", "")>]
static member Compare : bool * bool -> int

Parameters

x
Boolean

the first boolean to compare

y
Boolean

the second boolean to compare

Returns

the value 0 if x == y; a value less than 0 if !x && y; and a value greater than 0 if x && !y

Attributes

Remarks

Compares two boolean values. The value returned is identical to what would be returned by:

Boolean.valueOf(x).compareTo(Boolean.valueOf(y))

Added in 1.7.

Java documentation for java.lang.Boolean.compare(boolean, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to