対象のインスタンスが、指定したオブジェクトに等しいかどうかを示す値を返します。
Overrides Public Function Equals( _
ByVal obj As Object _) As Boolean
[C#]
public override bool Equals(objectobj);
[C++]
public: bool Equals(Object* obj);
[JScript]
public override function Equals(
obj : Object) : Boolean;
パラメータ
- obj
このインスタンスと比較するオブジェクト。
戻り値
obj が Single のインスタンスで、このインスタンスの値に等しい場合は true 。それ以外の場合は false 。
使用例
[Visual Basic, C#, C++] Equals メソッドを次のサンプルで示します。
Obj1 = CType(500, Single)
If A.Equals(Obj1) Then
Console.WriteLine("The value type and reference type values are equal.")
End If
[C#]
obj1 = (Single)500;
if (a.Equals(obj1)) {
Console.WriteLine("The value type and reference type values are equal.");
}
[C++]
obj1 = __box((Single)500);
if (__box(a)->Equals(obj1)) {
Console::WriteLine(S"The value type and reference type values are equal.");
}
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard