Point.GetHashCode 方法

定义

返回此 Point 的哈希代码。

public:
 override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer

返回

Int32

Point 结构的哈希代码。

示例

以下示例演示如何获取结构的哈希代码 Point

private int getHashCodeExample()
{
    
    Point point1 = new Point(10, 5);

    // Get the hashcode of a Point structure
    int returnHashCode = point1.GetHashCode();

    return returnHashCode;
}

适用于