Share via


Integer.CompareTo(Integer) Method

Definition

Compares two Integer objects numerically.

[Android.Runtime.Register("compareTo", "(Ljava/lang/Integer;)I", "")]
public int CompareTo (Java.Lang.Integer anotherInteger);
[<Android.Runtime.Register("compareTo", "(Ljava/lang/Integer;)I", "")>]
member this.CompareTo : Java.Lang.Integer -> int

Parameters

anotherInteger
Integer

the Integer to be compared.

Returns

the value 0 if this Integer is equal to the argument Integer; a value less than 0 if this Integer is numerically less than the argument Integer; and a value greater than 0 if this Integer is numerically greater than the argument Integer (signed comparison).

Attributes

Remarks

Compares two Integer objects numerically.

Added in 1.2.

Java documentation for java.lang.Integer.compareTo(java.lang.Integer).

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

See also