I have created an arraylist in a class called bank below is a method i created in the bank class which is used to apply interest to all accounts in the array list by calling the method in the account class for every account in the arraylist but I am having trouble in getting the arraylist to apply the method to the accounts
public void Interest() { // bank is the name of the arraylist and .addInterest() is a method in the account class for (int i = 0; i< count; i++) bank.get(i).addInterest(); }
I have not dealt with arraylists very much so I am not too familiar with them, i assume that my syntax is incorrect because when i try to compile that result says "can't find symbol variable addInterest(). I can post more of the bank class or account class if needed. I appreciate any help or suggestions.