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