static Variable : static « Language Basics « VB.Net Tutorial






Option Strict On

Public Module Test
   Public Sub Main()
      For loopCtr As Integer = 1 to 10
         Console.WriteLine(Invocations())
      Next
   End Sub

   Private Function Invocations() As Integer
      Static i As Integer
      i += 1
      Return i
   End Function
End Module
1
2
3
4
5
6
7
8
9
10








1.7.static
1.7.1.static Variable
1.7.2.Call static method