Eine neue Klasse mit Propertys definieren

Public Class USState
   ' Eigenschaften
   Private myShortName As String
   Private myLongName As String
   
   ' Konstruktor
   Public Sub New(strLongName As String, strShortName As String)
      Me.myShortName = strShortName
      Me.myLongName = strLongName
   End Sub 'New

   ' ReadOnly Property zum auslesen des Kurznamens   
   Public ReadOnly Property ShortName() As String
      Get
         Return myShortName
      End Get
   End Property
   
   ' ReadOnly Property zum auslesen des Langnamens   
   Public ReadOnly Property LongName() As String
      Get
         Return myLongName
      End Get
   End Property
   
   ' überschreiben der bestehenden Funktion ToString()
   Public Overrides Function ToString() As String
      Return Me.ShortName + " - " + Me.LongName
   End Function 'ToString
End Class 'USState