vb System.Collections.Generic.Comparer<T>.IComparer.Compare类(方法)实例源码

下面列出了vb System.Collections.Generic.Comparer<T>.IComparer.Compare 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Collections.Generi   
' This explicit interface implementation
' compares first by the length.
' Returns -1 because the length of BoxA
' is less than the length of BoxB.
Dim LengthFirst As New BoxLengthFirst()

Dim bc As Comparer(Of Box) = CType(LengthFirst, Comparer(Of Box))

Dim BoxA As New Box(2, 6, 8)
Dim BoxB As New Box(10, 12, 14)
Dim x As Integer = LengthFirst.Compare(BoxA, BoxB)
Console.WriteLine()
Console.WriteLine(x.ToString())


问题


面经


文章

微信
公众号

扫码关注公众号