作者: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