APublic Class Product
Implements IComparable
Public productName As String
Public Sub New(ByVal _productName As String)
Me.productName = _productName
End Sub
Public Function CompareTo(ByVal obj As Object) As Integer _
Implements System.IComparable.CompareTo
Dim otherProduct As Product = DirectCast(obj, Product)
Return Me.productName.CompareTo(otherProduct.productName)
End Function
BPublic Class Product
Public productName As String
Public Sub New(ByVal _productName As String)
Me.productName = _productName
End Sub
Public Function CompareTo(ByVal obj As Object) As Integer _
Implements System.IComparable.CompareTo
Dim otherProduct As Product = DirectCast(obj, Product)
Return Me.productName.CompareTo(otherProduct.productName)
End Function
End Class
CPublic Class Product
Implements IEquatable
Public productName As String
Public Sub New(ByVal _productName As String)
Me.productName = _productName
End Sub
Public Function Equals(ByVal obj As Object) As Integer _
Implements System.IEquatable.Equals
Dim otherProduct As Product = DirectCast(obj, Product)
Return Me.productName.Equals(otherProduct.productName)
End Function
End Class
DPublic Class Product
Public productName As String
Public Sub New(ByVal _productName As String)
Me.productName = _productName
End Sub
Public Function Equals(ByVal obj As Object) As Integer
Dim otherProduct As Product = DirectCast(obj, Product)
Return Me.productName.Equals(otherProduct.productName)
End Function
End Class