If I have a function that in that function I declare:
Object arr = new Object;
Where are arr and the whole array stored? heap? stack? Does it matter if the declaration is in some function or in main()?
and let's say I also have these command lines:
arr = new String("abc"); arr = new List();
Boxes are memory locations (where binary numbers can be stored).
Arrows are memory references (i.e. pointers).