in

How to find out the length of an array in Java

How to find out the length of an array in Java

public

int arrayLength(int[] myArray) {

int emp;

for (int i = 0; ; i++) €

try k

tmp = myArray [11;

catch

(ArrayIndexOutOfBoundsException e) {

return i;

}

What do you think?

Written by codeitbro

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings