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# | Math.Abs() Method | Set - 2
- C# | Math.Abs() Method | Set - 1
- C# | Join() Method | Set - 1
- C# | SortedDictionary.Add() Method
- C# | Method Parameters
- C# | Math.Exp() Method
- C# | Copy() Method
- C# | PadLeft() Method
- C# | ToLower() Method
- C# | ToUpper() Method
- C# | IndexOfAny() Method
- TimeSpan.Add() Method in C#
- Decimal.Add() Method in C#
- C# | Method Overloading
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.