Imports System.Collections
public class Test
public Shared Sub Main
Dim m_employees As New Collection
m_employees.Add(New employee("A", "F", "F"))
m_employees.Add(New employee("B", "E", "H"))
m_employees.Add(New employee("C", "D", "I"))
Dim emp As employee
Dim employee_enumerator As IEnumerator
employee_enumerator = m_employees.GetEnumerator()
Do While (employee_enumerator.MoveNext)
emp = CType(employee_enumerator.Current, Employee)
If emp.FirstName = "Oingo" Then Continue Do
Console.WriteLine(emp.Title & " " & emp.FirstName & " " & emp.LastName)
Loop
End Sub
End class
Public Class Employee
Public FirstName As String
Public LastName As String
Public Title As String
Public Sub New(ByVal first_name As String, ByVal last_name As String, ByVal new_title As String
)
FirstName = first_name
LastName = last_name
Title = new_title
End Sub
End Class
|