Module Module1
Sub Main()
Dim lst As New List(Of String)(New String() {"VB.NET", "Java", "PHP", "C#", "C++"})
Dim o As Object = lst
Dim tc1 = TryCast(o, String)
If tc1 Is Nothing Then
Console.WriteLine("tc1 error" + vbNewLine)
End If
Dim tc2 = TryCast(o, List(Of String))
If tc2 Is Nothing Then
Console.WriteLine("tc2 error" + vbNewLine)
Else
Console.WriteLine(o(0))
Console.WriteLine(o(1))
Console.WriteLine(o(2))
End If
End Sub
End Module
' run:
'
' tc1 error
' VB.NET
' Java
' PHP