Module Module1
Sub Main()
Dim TheObject As New TheClass
Console.WriteLine("ThePublicData holds """ & TheObject.ThePublicData & """")
Console.WriteLine("TheMethod returns """ & TheObject.TheMethod() & """")
Console.WriteLine("TheProperty holds """ & TheObject.TheProperty & """")
End Sub
End Module
Class TheClass
Public ThePublicData = "Hello there!"
Private TheInternalData As String = "Hello there!"
Function TheMethod() As String
Return "Hello there!"
End Function
Public Property TheProperty() As String
Get
Return TheInternalData
End Get
Set(ByVal Value As String)
TheInternalData = Value
End Set
End Property
End Class
|