SByte.Equals 方法
定義
多載
Equals(Object) |
傳回值,指出這個執行個體 (Instance) 是否和指定的物件相等。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)
傳回值,指出這個執行個體 (Instance) 是否和指定的物件相等。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);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean
參數
- obj
- Object
與這個執行個體相互比較的物件。An object to compare with this instance.
傳回
如果 true
是 obj
的執行個體,並且等於這個執行個體的值,則為 SByte,否則為 false
。true
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
參數
傳回
如果 true
與這個執行個體具有相同的值,則為 obj
,否則為 false
。true
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.