'Visual Basic 2010 Nut van OOP Object Oriented Programming Module Client2 Sub Main() ' create some new loans Dim loan1 As New Loan With {.Amount = 1000, .IntrestRate = 5} Dim loan2 As New Loan With {.Amount = 5000, .IntrestRate = 10} Dim loan3 As New Loan With {.Amount = 10000, .IntrestRate = 2} ' create new loan-collection Dim loans1 As New Loans ' add created loans to collection loans1.Add(loan1) loans1.Add(loan2) loans1.Add(loan3) ' remove the second loan-datagroup from the collection loans1.RemoveAt(1) ' get total payments for all loans : For index As Integer = 0 To loans1.Count - 1 Console.WriteLine(loans1.Item(index).GetTotalPayment()) Next ' Console.ReadLine() End Sub End Module 'Bezoek www.vbvoorbeelden.be voor meer Visual Basic voorbeelden. 'Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.