Home Help Java A Java Array Length
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Java Array Length

Advertisement
The java array enables the user to store values of the same type in contiguous memory allocations.

Java Array Length

     

In this section, you will learn about the java array length.

The java array enables the user to store values of the same type in contiguous memory allocations. Arrays are always a fixed length abstracted data structure  which can not be altered when required.

The Array class implicitly extends java.lang.Object so an array is an instance of Object. Arrays have one named instance variable called length. It contains the length of an array (number of elements).

For getting length of array, you can use array_name.lenght.

String months[] = {"Jan", "Feb", "Mar", "Apr", "May",
 "Jun", "July", "Aug", "Sep", "Oct", "Nov", "Dec"};

months.lenght = 12;

To get more information about array click on:

http:/www.roseindia.net/java/language/introduction-to-java-arrays.shtml

 

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: December 12, 2008

Related Tutorials

Ask Questions?    Discuss: Java Array Length  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Java Starter
April 2, 2011
You've problem in your code

hello, ROSE INDIA, You have problem in your codes.. Though I'm Java Numb there the spelling of length is not correct, correct it..
hal
November 19, 2011
spelling...

do you mean length rather than lenght? thanks hal
Jo Mama
January 28, 2012
Comment

First of all, you spelled the word length wrong. For it to work you need to spell words correctly you tard. Go back to India and learn all over again.
Jim
August 16, 2012
Mistake

There's a little mistake; your wrote lenght, but it is length :)
DMCA.com