# Initializing Linked List in VB.net



## theboz808 (Nov 18, 2008)

Does anyone know how to initialize a linked list in VB.net? The MS documentation gave this hokey method using a array when the list object is dimensioned.

Dim StartList(0) As Long
StartList(0) = A

Dim IntListA As New LinkedList(Of Long)(StartList) 

What I'd LIke to do is create a Public object
Public IntListA as New LinkedList(Of Long)

Then when I go to use it, test for an empty list. If it's empty, somehow initialize it, otherwise just add to it.

If IsNothing(IntListA) Then
' initialize list with A ????
Else
IntListA.AddAfter(IntListA.First, A)
End If


----------

