Java Array getLength() Method

The getLength() method of Array class returns the length of the specified array object, as an int.

Syntax

Parameter

array - the array

index - the index

Returns

the length of the array

Throw

IllegalArgumentException

Example 1

Test it Now

Output:

890
980
[890, 980]

Example 2

Test it Now

Output:

Array length :: 2




Latest Courses