Home » Java Array getInt() Method

Java Array getInt() Method

by Online Tutorials Library

Java Array getInt() Method

The getInt() method of Array class returns the value of the indexed component in the specified array object, as an int.

Syntax

Parameter

array – the array

index – the index

Returns

the value of the indexed component in the specified array

Throws

NullPointerException

IllegalArgumentException

ArrayIndexOutOfBoundsException –

Example 1

Test it Now

Output:

arr[0] = 90  arr[1] = 89  arr[2] = 79  

Example 2

Test it Now

Output:

value : 80  
Next TopicJava Array Class

You may also like