Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Beginners Arrayexamples Structure of Java Arrays

Related Tutorials


 
 

Share on Google+Share on Google+

Structure of Java Arrays

Advertisement
Now lets study the structure of Arrays in java. Array is the most widely used data structure in java. It can contain multiple values of the same type.

Structure of Java Arrays

     

Now lets study the structure of Arrays in java. Array is the most widely used data structure in java. It can contain multiple values of the same type. Moreover, arrays are always of fixed length i.e. the length of an array cannot be increased or decreased.

Lets have a close look over the structure of Array. Array contains the values which are implicitly  referenced through the index values. So to access the stored values in an array we use indexes. Suppose an array contains "n"  integers. The first element of this array will  be indexed with the "0" value and the last integer will be referenced by "n-1" indexed value.

Presume an array  that contains 12 elements as shown  in the figure. Each element is holding a distinct value. Here the first element is refrenced by a[0] i.e. the first  index value. We have filled the 12 distinct values in the array each referenced as:

a[0]=1

a[1]=2

...

a[n-1]=n

...

a[11]=12

The figure below shows the structure of an Array more precisely.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: May 28, 2007

Related Tutorials

Discuss: Structure of Java Arrays   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com