Public Class Point
Private x As Integer
Private y As Integer
Public Sub New(x As Integer, y As Integer)
Me.x = x
Me.y = y
End Sub
Public Overrides Function GetHashCode() As Integer
Return Tuple.Create(x, y).GetHashCode()
End Function
End Class
Module Module1
Sub Main()
Dim pt As New Point(7, 3)
Console.WriteLine(pt.GetHashCode())
pt = New Point(3, 7)
Console.WriteLine(pt.GetHashCode())
End Sub
End Module
' run:
'
' 228
' 100