You need to think about what exactly you're trying to do.
Write a test program that programatically adds a few Accounts with hardcoded names to an ArrayList of Accounts. Then write a function that...
Type: Posts; User: KevinWorkman
You need to think about what exactly you're trying to do.
Write a test program that programatically adds a few Accounts with hardcoded names to an ArrayList of Accounts. Then write a function that...
Your ArrayList only holds Accounts:
ArrayList<Account>account = new ArrayList<Account>();
You never add any Strings to that ArrayList. In fact, that would cause a compiler error. Yet you check...
You're only ever adding in Accounts to your ArrayList. It will never contain a String.
I would recommend creating a test program: can you write a simple main method that initializes an ArrayList, adds 10 Objects to it, then prints the ArrayList out? Which part of that simple program...
I would recommend creating a test program: can you write a simple main method that initializes an ArrayList, adds 10 Objects to it, then prints the ArrayList out? Which part of that simple program...