I'm writing this code where I can add an object (PhoneNumber) to an array of objects, (PhoneNumberList). What I'm confused about is how would I initialize the PhoneNumberList constructor?
So if I want to add a PhoneNumber to the PhoneNumberList, how should I initialize the PhoneNumberList()?
public class PhoneNumberList {
private PhoneNumber[] storage;
private static final int INITIAL_SIZE = 2;
// Purpose:
// Initialize a new instance of PhoneNumberList
public PhoneNumberList() {
storage = new PhoneNumber[INITIAL_SIZE];
}
}