Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (7k points)
Can someone tell me how to find the size of an integer array in Java?

1 Answer

0 votes
by (13.1k points)

To find integer array size in java you have to use arrayname.length 

For example:

public class Main

{

public static void main(String[] args) {

int[] array={1,2,3,4,5};

for(int i=0;i<array.length;i++){

    System.out.println(array[i]);

}

  

}

}

Interested to learn Java? Check out this java certification from Intellipaat.

Related questions

0 votes
1 answer
asked Jul 31, 2019 in Java by ParasSharma1 (19k points)
0 votes
1 answer
0 votes
1 answer
asked Feb 15, 2021 in Java by Jake (7k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...