- 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(Object) Method in C#
The Byte.Equals(Object) method in C# returns a value indicating whether this instance is equal to a specified object.
Syntax
Following is the syntax −
public override bool Equals (object ob);
Above, ob is an object to compare with this instance or null.
Example
Let us now see an example to implement the Byte.Equals(Object) method −
using System; public class Demo { public static void Main(){ byte b1; b1 = 5; object b2 = 5/10; 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 is not equal to b2
Advertisements