How can I turn this array into an ArrayList that does the same thing?
问题 I want to make turn this program's array into an ArrayList. So far I know that the array will turn into ArrayList<StudentList> list = new ArrayList<StudentList>(); and that each list[i] will turn into: list.get(i) however I am not sure what the following line will be in order to satisfy the ArrayList version list[i] = new StudentList(); so here is the full code: public static void main(String[] args) { StudentList[] list = new StudentList[5]; int i; for (i = 0; i < list.length; ++i) { list[i]