SByte.Equals 方法

定义

返回一个值,该值指示此实例是否与指定的对象或 SByte 相等。Returns a value indicating whether this instance is equal to a specified object or SByte.

重载

Equals(Object)

返回一个值,该值指示此实例是否等于指定的对象。Returns a value indicating whether this instance is equal to a specified object.

Equals(SByte)

返回一个值,该值指示此实例是否等于指定的 SByte 值。Returns a value indicating whether this instance is equal to a specified SByte value.

Equals(Object)

返回一个值,该值指示此实例是否等于指定的对象。Returns a value indicating whether this instance is equal to a specified object.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
public override bool Equals (object? obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

参数

obj
Object

与此实例进行比较的对象。An object to compare with this instance.

返回

Boolean

如果 trueobj 的实例并且等于此实例的值,则为 SByte;否则为 falsetrue if obj is an instance of SByte and equals the value of this instance; otherwise, false.

另请参阅

适用于

Equals(SByte)

返回一个值,该值指示此实例是否等于指定的 SByte 值。Returns a value indicating whether this instance is equal to a specified SByte value.

public:
 virtual bool Equals(System::SByte obj);
public bool Equals (sbyte obj);
override this.Equals : sbyte -> bool
Public Function Equals (obj As SByte) As Boolean

参数

obj
SByte

要与此实例进行比较的 SByte 值。An SByte value to compare to this instance.

返回

Boolean

如果 true 的值与此实例相同,则为 obj;否则为 falsetrue if obj has the same value as this instance; otherwise, false.

实现

注解

此方法实现 System.IEquatable<T> 接口,并且执行的效果略优于, Equals 因为无需将 obj 参数转换为对象。This method implements the System.IEquatable<T> interface, and performs slightly better than Equals because it does not have to convert the obj parameter to an object.

适用于