Boolean.Equals Boolean.Equals Boolean.Equals Boolean.Equals Method

定義

傳回表示這個執行個體是否等於指定物件或 Boolean 的值。Returns a value indicating whether this instance is equal to a specified object or Boolean.

多載

Equals(Boolean) Equals(Boolean) Equals(Boolean) Equals(Boolean)

傳回表示這個執行個體是否等於指定 Boolean 物件的值。Returns a value indicating whether this instance is equal to a specified Boolean object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

傳回值,指出這個執行個體 (Instance) 是否和指定的物件相等。Returns a value indicating whether this instance is equal to a specified object.

Equals(Boolean) Equals(Boolean) Equals(Boolean) Equals(Boolean)

傳回表示這個執行個體是否等於指定 Boolean 物件的值。Returns a value indicating whether this instance is equal to a specified Boolean object.

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

參數

obj
Boolean Boolean Boolean Boolean

要與此執行個體相比較的 Boolean 值。A Boolean value to compare to this instance.

傳回

如果 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.

另請參閱

Equals(Object) Equals(Object) Equals(Object) 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 Object Object Object

與這個執行個體相比較的物件。An object to compare to this instance.

傳回

如果 trueobj,且具有與這個執行個體相同的值,則為 Boolean,否則為 falsetrue if obj is a Boolean and has the same value as this instance; otherwise, false.

備註

這個方法覆寫 EqualsThis method overrides Equals.

另請參閱

適用於