Java Arraylength Property
Example
Find out how many elements an array has:
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};System.out.println(cars.length);Definition and Usage
Thelength property returns the length of an array.
This is a built-in Java property, and does not belong to theJava Arrays Class.
Note: Thelengthpropertymust not be mistaken with thelength()methodthat is used for Strings.
Syntax
array.lengthRelated Pages
❮ Arrays Methods

