generic list of T question

S

Simon Whale

[VB 2005 Pro]

I need to pass a list of T object to a class, but as i haven't had to use it
often i need someone to help me to a nice example of one :)

Many Thanks
Simon Whale
 
A

Armin Zingler

Simon said:
[VB 2005 Pro]

I need to pass a list of T object to a class, but as i haven't had to use it
often i need someone to help me to a nice example of one :)


Public Class Main

Shared Sub Main()
Dim list As New List(Of Integer)
list.Add(17)
list.Add(12)
MySub(list)
End Sub

Shared Sub MySub(ByVal list As List(Of Integer))
For Each item In list
Debug.Print(item.ToString)
Next
End Sub

End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top