- 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
Byte.Equals(Byte) Method in C#
The Byte.Equals(Byte) method in C# returns a value indicating whether this instance and a specified Byte object represent the same value.
Syntax
Following is the syntax −
public bool Equals (byte ob);
Above, ob is an object to compare to this instance.
Example
Let us now see an example to implement the Byte.Equals(Byte) method −
using System; public class Demo { public static void Main(){ byte b1, b2; b1 = 5; b2 = 5; if (b1.Equals(b2)) Console.Write("b1 = b2"); else Console.Write("b1 is not equal to b2"); } }
Output
This will produce the following output −
b1 = b2
Advertisements