C# | Boolean.Equals(Boolean) Method Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report This method is used to return a value indicating whether this instance is equal to a specified Boolean object.Syntax: 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:Example 1: CSHARP // C# program to demonstrate // Boolean.Equals(bool obj) // Method using System; class GFG { // Main Method public static void Main() { // passing different values // to the method to check check(true, true); check(true, false); check(false, true); check(false, false); } // Defining check method public static void check(bool input1, bool input2) { // declaring bool variable bool val; // Checking the equality val = input1.Equals(input2); // checking the equivalency if (val == true) Console.WriteLine("{0} is equal to {1}", input1, input2); else Console.WriteLine("{0} is not equal to {1}", input1, input2); } } Output: True is equal to True True is not equal to False False is not equal to True False is equal to False Example 2: CSHARP // C# program to demonstrate // Boolean.Equals(bool obj) // Method using System; class GFG { // Main Method public static void Main() { // Declaring the variable // input1 and input2 bool input1, input2; // initializing the variables input1 = true; input2 = false; // checking the equality bool val = input1.Equals(input2); // checking the equivalency if (val == true) Console.WriteLine("input1 is equal to input2"); else Console.WriteLine("input1 is not equal to input2"); } } Output: 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.Reference: https://learn.microsoft.com/en-us/dotnet/api/system.boolean.equals?view=netframework-4.7.2#System_Boolean_Equals_System_Boolean_ Comment R rohitprasad3 Follow 0 Improve R rohitprasad3 Follow 0 Improve Article Tags : C# CSharp-method CSharp Boolean Struct Explore IntroductionC# Tutorial 2 min read Introduction to .NET Framework 6 min read C# .NET Framework (Basic Architecture and Component Stack) 6 min read C# Hello World 2 min read Common Language Runtime (CLR) in C# 4 min read FundamentalsC# Identifiers 2 min read Data Types in C# 6 min read C# Variables 4 min read C# Literals 5 min read Operators in C# 7 min read C# Keywords 5 min read Control StatementsC# Decision Making (if, if-else, if-else-if ladder, nested if, switch, nested switch) 5 min read C# Switch Statement 4 min read Loops in C# 4 min read C# Jump Statements (Break, Continue, Goto, Return and Throw) 4 min read OOP ConceptsClass and Objects in C# 4 min read Constructors in C# 5 min read C# Inheritance 3 min read Encapsulation in C# 2 min read C# Abstraction 4 min read MethodsMethods in C# 4 min read Method Overloading in C# 4 min read Method Parameters in C# 4 min read Method Overriding in C# 7 min read Anonymous Method in C# 2 min read ArraysArrays in C# 6 min read Jagged Arrays in C# 4 min read Array Class in C# 5 min read How to Sort an Array in C# | Array.Sort() Method Set - 1 8 min read How to find the rank of an array in C# 2 min read ArrayListArrayList in C# 6 min read ArrayList Class in C# 4 min read C# | Array vs ArrayList 2 min read StringStrings in C# 6 min read C# Verbatim String Literal - @ 5 min read C# String Class 9 min read C# StringBuilder 4 min read C# String vs StringBuilder 3 min read TupleC# Tuple 7 min read C# Tuple Class 3 min read C# ValueTuple 7 min read C# ValueTuple Struct 4 min read IndexersC# Indexers 5 min read C# Multidimensional Indexers 5 min read C# - Overloading of Indexers 3 min read Like