Where are arrays stored in memory?

If I have a function in which I declare:

Object arr[] = new Object[20];

Where are the ARR and the entire array stored? Pile? Superposition? Is it important if it is declared in some functions or main()?

Let's say I also have these command lines:

arr[0] = new String("abc");
arr[1] = new List();

Where are arr [0] and arr [1] stored?

Solution

Memory map:

A box is a memory location (where binary numbers can be stored) Arrows are memory references (i.e. pointers)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>