1 Module Module1
2 Property EmpName As String = "Mary"
3 Sub Main()
4 Console.WriteLine(EmpName)
5 End Sub
6 End Module
2.Collection Initializers & Statement Lambdas ,
除了3.5的Array Initializer之外,多了Collection Initializers
1 Module Module1
2 Sub Main()
3 '陣列初始設定式
4 Dim dataArr() As Integer = {1, 4, 23, 21, 34, 24}
5 Array.ForEach(dataArr, Sub(x)
6 Console.WriteLine(x)
7 End Sub)
8
9 '集合初始設定式
10 Dim dataCol As New List(Of Integer) From {1, 4, 23, 21, 34, 24}
11 dataCol.ForEach(Sub(x)
12 Console.WriteLine(x)
13 End Sub)
14 End Sub
15 End Module
沒有留言:
張貼留言