Field initialization : Member Fields « Class Module « VB.Net Tutorial






Imports System

Module Test
  Sub Main()
    Dim obj As YourClass
    obj = New YourClass()
    Console.WriteLine("Name is: " & obj.Name)
    Console.WriteLine("Address is: " & obj.Address)
    Console.WriteLine("ID is: " & obj.ID)
  End Sub
End Module

Public Class YourClass
  Public Name As String = "New YourClass"
  Public Address As String
  Public ID As Integer
End Class
Name is: New YourClass
Address is:
ID is: 0








6.12.Member Fields
6.12.1.Shadow member variable in base class
6.12.2.Shadow fields
6.12.3.Shared field
6.12.4.Field initialization
6.12.5.Public Field