I have got a class called Customers with an Arraylist inside to store information about the Customer Accounts; then inside Accounts class I have an Arraylist to hold the Transactions.
My question is, how would I go about saving to the Arraylist found within the Customer Class. It doesnt seem like I can access it.
if (allInputOK)
{
//create Account
Account temp = new Account(tempAccSortCode, tempAccNumber, tempAccNickName, tempAccDate, tempAccCurBal, tempAccOverDraft, tempNumTrans);
//add to array
//Need to add here.
//finish up
MessageBox.Show("Success Account added ");
resetForm();
}
This is my method on a form to add to the Arraylist. It first checks the input is OK, then creates a new Account called temp (Account is the Class name). Then how do I go about saving this inside of the Arraylist inside the Class Account?
Thanks.
ArrayList? Why not expose yourArrayListas Swaff describes below and just use the built-inArrayListmethods (likeAdd())?