vb System.ValueType.Equals类(方法)实例源码

下面列出了vb System.ValueType.Equals 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:Syste   
Public Structure Complex
   Private m_Re As Double
   Private m_Im As Double
       
   Public Overloads Function Equals(ob As Object) As Boolean
      If TypeOf ob Is Complex Then
         Dim c As Complex = CType(ob, Complex)
         Return m_Re = c.m_Re And m_Im = c.m_Im
      Else
         Return False
      End If
   End Function
   
   
   Public Overloads Function GetHashCode() As Integer
      Return m_Re.GetHashCode() ^ m_Im.GetHashCode()
   End Function

End Structure


问题


面经


文章

微信
公众号

扫码关注公众号