The use of arrays and list

Person[] p = new Person[10];//Person
ArrayList<Person> pList = new ArrayList<Person>();

both p and pList above can be used to store data of person type. How to choose?
an array of functions that can be implemented by ArrayList can also be realized, so why is there ArrayList?

Mar.02,2021

ArrayListObject
 transient Object[] elementData

 private void grow(int minCapacity) {
        // overflow-conscious code
        int oldCapacity = elementData.length;
        int newCapacity = oldCapacity + (oldCapacity >> 1);
        if (newCapacity - minCapacity < 0)
            newCapacity = minCapacity;
        if (newCapacity - MAX_ARRAY_SIZE > 0)
            newCapacity = hugeCapacity(minCapacity);
        // minCapacity is usually close to size, so this is a win:
        elementData = Arrays.copyOf(elementData, newCapacity);
    }
Menu