Javatpoint Logo
Javatpoint Logo

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
Next TopicJava Array Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA