Short.Compare(Int16, Int16) 方法

定义

以数字方式比较两 short 个值。

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

参数

x
Int16

第一个 short 要比较的

y
Int16

要比较的第二个short

返回

如果为 值x == y0,则为 ;一个小于 0 if x < y的值;一个大于 0 if 的值x > y

属性

注解

以数字方式比较两 short 个值。 返回的值与将返回的值相同:

Short.valueOf(x).compareTo(Short.valueOf(y))

在 1.7 中添加。

java.lang.Short.compare(short, short)Java 文档。

此页面的某些部分是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的条款使用。

适用于