Public Const : Public « Class Module « VB.Net Tutorial






Imports System

Module MyTest
  Sub Main()
    Console.WriteLine(Counter.MIN_COUNT)
    Console.WriteLine(Counter.MAX_COUNT)

    Dim input As Integer = 100
    if input < Counter.MIN_COUNT or _
       Input > Counter.MAX_COUNT Then
      Console.WriteLine("Value is out of acceptable range!")
    Else
      Console.WriteLine("The value " & input.ToString() & _
                        " is acceptable!")
    End If
    
  End Sub
End Module

Public Class Counter
  Public Const MAX_COUNT As Integer = 500
  Public Const MIN_COUNT As Integer = 100
End Class
100
500
The value 100 is acceptable!








6.23.Public
6.23.1.Public members are available to anything that can instantiate this type
6.23.2.Public Const