This method is used to return a value indicating whether this instance is equal to a specified Boolean object.
public bool Equals (bool obj);
Here, obj is a boolean value to compare to this instance.
Return Value: This method returns true if obj has the same value as this instance otherwise it returns false.
Below programs illustrate the use of Boolean.Equals(bool obj) Method:
True is equal to True True is not equal to False False is not equal to True False is equal to False
input1 is not equal to input2
Note: 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.
- Difference between Method Overriding and Method Hiding in C#
- C# | Dictionary.Add() Method
- C# | Math.Sin() Method
- C# | SortedDictionary.Add() Method
- C# | IndexOfAny() Method
- C# | Math.Cos() Method
- C# | Math.Tan() Method
- C# | Math.Log() Method
- C# | Replace() Method
- C# | Insert() Method
- C# | Method Overriding
- C# | Clone() Method
- C# | Remove() Method
- C# | StartsWith() Method
- C# | Uri.IsHexEncoding() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.