So in a language like C, memory is separated into 5 different parts: OS Kernel, text segment, static memory, dynamic memory, and the stack. Something like this:
The value of a
is just a reference to an object. The array creation expression (new int[2]
) creates a new object of the right size, and assigns a reference to a
.
Note that static
in Java is fairly separate to static
in C. In Java it just means "related to the type rather than to any particular instance of the type".