---
tags: Setup-Summer21
---
# Lecture 16 Setup/Prep
In our banking code, our main methods on lists of accounts and customers are `findCustomer` and `findAccount`. Currently, we implement both of these via for-loops over lists.
Might there be a faster way to access individual customers or accounts? For accounts in particular, each one has a numeric ID number. This suggests that we might maintain an *array of accounts* instead: each `Account` object could get stored in the index corresponding to its ID number.
## Prep
Consider the following questions:
- Do you think an array is a good choice of a data structure for accounts, if we want frequently open accounts and look up accounts by number, and sometimes close accounts? Why or why not?
- Assume that we added a unique username to the Customer class. Would an array be useful for helping us quickly access Customers based on their usernames? Why or why not?
**Added 10:25 Fri morning** -- for the programming portion for today, just make a lec16 package and copy the `Customer` and `Account` classes over from the last lecture. You don't need the full classes -- just the classes and the fields (and constructors) will suffice.
I will also work in a `Main` class with an initially empty `main` method.