
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Boolean.Equals(Boolean) Method in C#
The Boolean.Equals(Boolean) method in C# returns a value indicating whether this instance is equal to a specified Boolean object.
Syntax
Following is the syntax −
public bool Equals (bool ob);
Above, ob is a Boolean value to compare to this instance.
Example
Let us now see an example to implement the Boolean.Equals(Boolean) method −
using System; public class Demo { public static void Main(){ bool b1 = false; bool b2 = true; bool res = b1.Equals(b2); if (res == true) Console.Write("b1 equal to b2"); else Console.Write("b1 not equal to b2"); } }
Output
This will produce the following output −
b1 not equal to b2
- Related Articles
- Boolean.CompareTo(Boolean) Method in C#
- Convert Java Boolean Primitive to Boolean object
- Create a Boolean object from Boolean value in Java
- Java Program to convert boolean value to Boolean
- Explain non-boolean value coercion to a boolean one in JavaScript?
- Boolean Type in Java
- Boolean Literals in Java
- Boolean Indexing in Pandas
- Boolean Indexing in Python
- Boolean Values in Python
- Boolean Gates in JavaScript
- Python Boolean Operations
- C++ Boolean Matrix
- Java Boolean operators
- Generate Random boolean in Java

Advertisements