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






Imports System

Module PointPublic
  Sub Main()

    Dim p as Point = New Point()

    Console.WriteLine("(" & p.X & "," & p.Y & ")") 
    p.X = -100
    p.Y = -100

    Console.WriteLine("(" & p.X & "," & p.Y & ")") 

  End Sub
End Module

Public Class Point

  Public Y as Integer  'Public Field
  Public X as Integer  'Public Field

End Class
(0,0)
(-100,-100)








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