I have the following in class A:
static ArrayList<Student> students;
I have the following in class B:
public static void populate_students(ArrayList<Student> students) {
students = new ArrayList<Student>();
// ...
}
in the debug mode, I see that student
is initialized (not null) in the method but after returning to class A, student is null. Why is this the case? I thought that changes made on an object are visible from everywhere in Java.