How would one go about keeping track of a classes objects by pushing the new instances to an Array, and to allow this array to be edited/popped by an object of another class.
For example;
The object 'airplane' (Plane class) is created, and pushed to an Array called 'in-flight'.
The object 'airport' (Airport class) asks it to land and pops from the array.
Is there a way to do so, with and/or without the use of class variables?
.new. This factory method, beside creation of objects, can also register them in some array or whatever