nawervery.blogg.se

Declaare array vs arraylist
Declaare array vs arraylist











Object where the user inputs the values, it will not work since the variable names are in separate classes. However, I have a feeling that it will not/does not work at this point since if I want to create a new Savings Account I did what you said, and now I am trying to work on the Array List so that new accounts can be added and so that customers can be searched. He builds his castles in the air, from air, creating by exertion of the imagination." - Fred Brooks "The programmer, like the poet, works only slightly removed from pure thought-stuff. This way you know what's happening to the array. Static void AddNewSavingsAccount( ArrayList accounts) Static void AddNewCurrentAccount( ArrayList accounts)

#Declaare array vs arraylist code

Stay away from global variables they will turn the code into a big ball of highly unstable code where a change in one unrelated section breaks code in an even unrelated section of code and you have no idea whether it did break or why.Ĭase "1": AddNewCurrentAccount( accounts) break Ĭase "2": AddNewSavingsAccount( accounts) break You were told wrong Andrew! (ah wait edit. "I was told that the ArrayList could be declared globally" I have 4 classes, which are Account, CurrentAccount:Account, SavingsAccount:Account and Program and I am not aiming to add a fifth class Console.Write( "\t\t\t\tMain Menu\n\n1: Add New Savings Account\n2: Add New Current Account\n3: Search Customer Accounts\n4: Deposit Cheque\n5: Transfer Money\n6: Check Balance\n7: Add New Quarter\n8: Help \n9: Quit\n\nWhen done, press Enter to continue ") Ĭonsole.Write( "\t\t\t\tCustomer Menu\n\nnWhen done, press Enter to continue ") Īny help where I would put ArrayList AccountArrayList and AccountArrayList = new ArrayList would be greatly appreciated.











Declaare array vs arraylist