![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
UInt32.Equals() Method in C# with Examples
The UInt32.Equals() method in C# returns a value indicating whether this instance is equal to a specified object or UInt32.
Syntax
Following is the syntax −
public override bool Equals (object ob); public bool Equals (uint ob);
Above, the parameter ob for the 1st syntax is an object to compare to this instance and the parameter ob for the 2nd syntax is the 32-bit unsigned integer to compare to this instance.
Example
Let us now see an example to implement the UInt32.Equals() method −
using System; public class Demo { public static void Main(){ uint val1 = 52; uint val2 = 10; bool res = val1.Equals(val2); Console.WriteLine("Return value (comparison) = "+res); if (res) Console.WriteLine("val1 = val2"); else Console.WriteLine("val1 != val2"); } }
Output
This will produce the following output −
Return value (comparison) = False val1 != val2
Example
Let us now see another example to implement the UInt32.Equals() method −
using System; public class Demo { public static void Main(){ uint val1 = 100; uint val2 = 100; bool res = val1.Equals(val2); Console.WriteLine("Return value (comparison) = "+res); if (res) Console.WriteLine("val1 = val2"); else Console.WriteLine("val1 != val2"); } }
Output
This will produce the following output −
Return value (comparison) = True val1 = val2
Advertisements