Home Help Java A Java Array Length



Java Array Length
Posted on: December 12, 2008 at 12:00 AM
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

 

Related Tags for Java Array Length:
javacarraysmemoryarraydatauiiostructusertypestructuretracvaluelocationlengthabstractcteallocationvaluestostorerequirefixedealterenablenotbstrcanusepeinnomnttrcajesemallallocaaltmemolocmecattorsamewhenwhichsxebstatracirllrayaractstrsavassamssamtigthcontiguousavstabablatialuallocfixono


More Tutorials from this section

Ask Questions?    Discuss: Java Array Length  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.