- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements