0

Array length?

Fill in the blank to retrieve a number of elements in an array called "test"

29th Dec 2016, 6:42 AM
Isaac M
3 ответов
+ 1
public class Program { public static void main(String[] args) { int[] test = {5,6,7,8}; int counter = 0; for (int i = 0; i < test.length; i ++){ if (test[i] != 0){ counter ++; } } System.out.println (counter ); } }
29th Dec 2016, 7:49 AM
seyfullah
seyfullah - avatar
+ 1
Appreciate.
29th Dec 2016, 7:57 AM
Isaac M
0
no problem 👍
29th Dec 2016, 7:58 AM
seyfullah
seyfullah - avatar