Monday 29 August 2011

Variable block scope

public class Test
   public Shared Sub Main
        For i As Integer = To 5
            Dim As Integer = 3
            If i = j Then
                Dim As Integer = i + j
                Console.WriteLine("M: " & M)
            Else
                Dim As Integer = i * j
                Console.WriteLine("N: " & N)
            End If
            Dim As Integer = 123
            Console.WriteLine("k: " & k)
        Next i
   End Sub
End class

No comments:

Post a Comment