Imports System
Public Class MainClass
Shared Sub Main()
'Declare a Customer object
Dim objNewCustomer As Customer
'Create the new customer
objNewCustomer.FirstName = "f"
objNewCustomer.LastName = "l"
objNewCustomer.Email = "e"
System.Console.WriteLine(objNewCustomer)
End Sub
End Class
Public Structure Customer
'Public members
Public FirstName As String
Public LastName As String
Public Email As String
'Name property
Public ReadOnly Property Name() As String
Get
Return FirstName & " " & LastName
End Get
End Property
'''
''' Overrides the default ToString method
'''
''' String
''' Returns the customer name and email address
Public Overrides Function ToString() As String
Return Name & " (" & Email & ")"
End Function
End Structure