' Visual Basic 2008 9.0 .NET Examples - Local Type Inference - New in Visual Basic 2008 - 9.0 : Option Infer On Option Explicit Off Option Strict Off Class Example1 Public Shared Sub Main() Dim value1 = 1 Dim value2 = "2" Dim value3 = "3"c Dim value4 = GetSomeByte() Dim value5 = New Integer() {1, 2, 3} For Each value6 In value5 ' ... Next Static value7 = 4 ' Console.ReadLine() End Sub Public Shared Function GetSomeByte() As Byte End Function End Class Class Example2 Private Shared variable1 Private Shared variable2 = "a" Public Shared Sub Main() variable1 = 1 Dim variable3 variable3 = 2S Dim variable4 = "b"c variable5 = "c" Dim variable6 = SomeFunction(variable4, variable5) Dim variable10 = 3UI 'Stop End Sub Public Shared Function SomeFunction(ByVal variable7, _ Optional ByVal variable8 = "d", _ Optional ByVal variable9 = 4) SomeFunction = variable8 'Stop End Function End Class ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.