Newer
Older
labs / tiddlers / content / review / java_exercises / _Review_Data Access Class.md
@Mark George Mark George on 15 Jul 2021 546 bytes Add review exercises

Create a new class that represents a contact list, and extend your program to use the new class. The class is effectively a data access class for managing the contacts.

  1. The class should contain a private field that is a collection (use ArrayList) of contact objects.

  2. Add a method that takes a contact object as a parameter and add it to the list.

  3. Add a method that displays the list of contacts in the console.

  4. Modify your program so that it uses an instance of your new contact list class instead of using an array.