bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Array length Property

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Java Array length Property?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The length property returns the length of an array.
Definition and Usage
Java Array length Property

❮ Arrays Methods

Example

String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
System.out.println(cars.length);

Definition and Usage

The length property returns the length of an array.

This is a built-in Java property, and does not belong to the Java Arrays Class .

Note

The length property must not be mistaken with the length() method that is used for Strings.

Syntax

array .length

Previous

Java Arrays. fill() Method

Next

Java ArrayList Methods