aspose file tools*
The moose likes Beginning Java and the fly likes Data Structure used by Java array. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Data Structure used by Java array." Watch "Data Structure used by Java array." New topic
Author

Data Structure used by Java array.

Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
Hello Friends,


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.



Thanks in advance!


God Gave Me Nothing I Wanted, He Gave Me Everything I Needed.
OCPJP6
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Ashish Tiwari wrote:Array is a data structure itself.


Yes. it is a Linear Data Structure
Ulrika Tingle
Ranch Hand

Joined: Nov 24, 2009
Posts: 92
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?
Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
Ulrika Tingle wrote:
In fact, the existence of contiguous random access memory was what inspired the array data structure in the first place.



Thanks Ulrika & Seetharaman

Thanks a lot !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data Structure used by Java array.