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

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

作者:VB.NET开发    项目:Syste   
' 导入命名空间
Imports Corporate.EmployeeObjects

Module Example
   Public Sub Main()
      Dim empA As New EmployeeA With { .Name = "Robert" }
      Console.WriteLine(empA.ToString())
      
      Dim empB = new EmployeeB With { .Name = "Robert" }
      Console.WriteLine(empB.ToString())
   End Sub
End Module

Namespace Corporate.EmployeeObjects
    Public Structure EmployeeA
         Public Property Name As String 
    End Structure
    
    Public Structure EmployeeB
         Public Property Name As String 

         Public Overrides Function ToString() As String 
              Return Name
         End Function
    End Structure  
End Namespace


问题


面经


文章

微信
公众号

扫码关注公众号