Private Member Variable : Private « Class « VB.Net






Private Member Variable

Imports System

Public Class MainClass

    Shared Sub Main(ByVal args As String())
       Dim timeObject As New Time( )
       timeObject.DisplayCurrentTime( )
    End Sub
End Class

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

           
       








Related examples in the same category

1.Public and private demoPublic and private demo