Class with Private fields and Public method : Private « Class Module « VB.Net Tutorial






Imports System

 Public Class Time
    ' Private variables
    Private Year As Integer
    Private Month As Integer
    Private Hour As Integer
    Private Minute As Integer
    Private Second As Integer
    ' Public methods
    Public Sub DisplayCurrentTime( )
       Console.WriteLine("stub for DisplayCurrentTime")
    End Sub 'DisplayCurrentTime
 End Class 'Time

 Module Module1
    Sub Main( )
       Dim timeObject As New Time( )
       timeObject.DisplayCurrentTime( )
    End Sub

 End Module
stub for DisplayCurrentTime








6.22.Private
6.22.1.Private members are only available to members of this class
6.22.2.Private class fields
6.22.3.Class with Private fields and Public method