Home » C#

C# | Uri.GetHashCode() Method with Example

Uri.GetHashCode() Method: Here, we are going to learn about the GetHashCode() method of Uri class with example in C#.
Submitted by Nidhi, on March 26, 2020

Uri.GetHashCode() Method

Uri.GetHashCode() method is an override method, it returns an integer value to represent hashcode of Uri.

Syntax:

    int Uri.GetHashCode();

Parameter(s):

  • This method does not contain any parameter.

Return value:

The return type of this method is int, it returns an Int32 (int) value containing the hash value generated for this URI.

Example to demonstrate example of Uri.GetHashCode() method

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        // Create an object of Uri
        Uri Address;

        int hashCode = 0;

        Address = new Uri("http://www.includehelp.com");

        //Get hashcode of Uri 
        hashCode = Address.GetHashCode();
        
        Console.WriteLine("Uri Hash Code: {0}",hashCode);
    }
}

Output

Uri Hash Code: 604841720
Press any key to continue . . .





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.