Array Length In Java
Chapter:
Miscellaneous
Last Updated:
21-07-2016 18:38:52 UTC
Program:
/* ............... START ............... */
public class JavaArrayLengthExample {
public static void main(String[] args)
{
String[] array = {"Java","Scan","Program Collection","Java"};
int arrayLength = array.length;
System.out.format("The Java array length is %d", arrayLength);
}
}
/* ............... END ............... */
Output
The Java array length is 4
Notes:
-
Array.length will give the length of array in Java.
- Array stores a fixed-size sequential collection of elements of the same type.
Tags
Array Length, Java