Hi kind of a noobish question, but I have a function that creates an ArrayList like
ArrayList<ArrayList<Integer>> inversePrefList = new ArrayList<>();
I append to this list throughout the function and inversePrefList ends up getting passed to main. My question is, in main do I have to declare a new object again? like
ArrayList<ArrayList<Integer>> inverseDoctorPrefList =
new ArrayList<>(createInversePreferenceList(problem.getDoctorPreference()));
or since the object already was allocated with 'new' in the function, should my line in main look like
ArrayList<ArrayList<Integer>> inverseDoctorPrefList =
createInversePreferenceList(problem.getDoctorPreference());
thank you.