C# Boolean Equals(Object)
Description
Boolean Equals(Object)
returns a value indicating whether
this instance is equal to a specified object.
Syntax
Boolean.Equals(Object)
has the following syntax.
public override bool Equals(
Object obj
)
Parameters
Boolean.Equals(Object)
has the following parameters.
obj
- An object to compare to this instance.
Returns
Boolean.Equals(Object)
method returns true if obj is a Boolean and has the same value as this instance; otherwise,
false.
Example
The following code example demonstrates Boolean.Equals(Boolean).
using System;/*from ww w .ja v a 2s. co m*/
class Sample
{
public static void Main()
{
Boolean a1 = true;
Object a2 = true;
Console.WriteLine(a1.Equals(a2));
}
}
The code above generates the following result.