Ashish Tiwari wrote:
Can any body tell me which Data Structure used by Java Array internally. As far as I know, Array is a data structure itself. Please correct me if I am wrong.
And what will be your next question? What data structure is the data structure using that Java arrays use internally?
It never ends and it doesn't matter really. You can take for granted that Java arrays end up being efficiently implemented using a piece of contigous memory. In fact, the existence of contiguous random access memory was what inspired the array data structure in the first place.
If this doesn't satisfy your curiosity you can of course look at the bytecode emitted by a Java compiler. Just write some Java code using an array and study the bytecode. This will show how the Java array is mapped on a bytecode array. But this again raises the question of what does the JVM do with this bytecode when it runs it on a specific computer?
Joined: Mar 19, 2008
Ulrika Tingle wrote:
In fact, the existence of contiguous random access memory was what inspired the array data structure in the first place.