
- 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
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
- Related Articles
- UInt32.GetTypeCode() Method in C# with Examples
- UInt32.ToString() Method in C# with Examples
- UInt32.CompareTo() Method in C# with Examples
- UInt32.GetHashCode() Method in C# with Examples
- UInt16.Equals Method in C# with Examples
- UInt64.Equals Method in C# with Examples
- Int16.Equals Method in C# with Examples
- Int32. Equals Method in C# with Examples
- Int64.Equals Method in C# with Examples
- UInt32.MaxValue Field in C# with Examples
- UInt32.MinValue Field in C# with Examples
- AngularJS – equals() method
- Integer Equals() method in Java
- LocalTime equals() method in Java
- MonthDay equals() method in Java

Advertisements