Variable Scope Demo : Variable Scope « Language Basics « VB.Net






Variable Scope Demo

Variable Scope Demo
Imports System

Public Class MainClass
    
    Shared Sub Main(ByVal args As String())
       DisplayAAAName()
       DisplayBBBName()
    End Sub


    Shared Sub DisplayAAAName()

        Dim myName As String
        myName = "AAA"

        Console.WriteLine(myName, "Scope Demo")

    End Sub

    Shared Sub DisplayBBBName()
        Dim myName As String
        myName = "BBB"

        Console.WriteLine(myName, "Scope Demo")
    End Sub
End Class

           
       








Related examples in the same category

1.Block scope variable XBlock scope variable X
2.Variable Scope: Function