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文档java.lang.Short.compare(short, short)

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

适用于