Public Class Point
    Private iX As Integer
    Private iY As Integer
    Public Sub New(ByVal pX As Integer, ByVal pY As Integer)
        iX = pX
        iY = pY
    End Sub
    Public Property X() As Integer
        Get
            Return iX
        End Get
        Set(ByVal Value As Integer)
            iX = Value
        End Set
    End Property
    Public Function Distance() As Double
        Return Math.Sqrt(iX * iX + iY * iY)
    End Function
    Public Overloads Overrides Function Equals(ByVal pObject As Object) As Boolean
        If (pObject Is Nothing Or Not (Me.GetType() Is pObject.GetType())) Then
            Return False
        End If
        Dim tPoint As Point = DirectCast(pObject, Point)
        Return Me.iX = tPoint.iX And Me.iY = tPoint.iY
    End Function
    Public Overrides Function ToString() As String
        Return iX & ":" & iY
    End Function
End Class