Every array in Java has a .length property that tells you how many elements it holds:
int[] scores = {90, 85, 78, 92, 88};
System.out.println(scores.length); // 5
Notice there are no parentheses after length. It is a field, not a method. This is different from String, where you call .length() with parentheses. Mixing the two up is a common compiler error.
The .length value never changes after creation. If you create an array with new int[10], its .length stays even if you only assign values to the first slots. The remaining slots still exist and hold their default values.