← Unit 4 · all exercises
Saved in this browser only

How many items

Return how many numbers are in the array. An array uses .length, with no brackets.

int size(int[] values)

Solution.java
Loading editor…
Results

Examples

  • Solution.size(new int[]{1, 2, 3}) → 3
  • Solution.size(new int[]{}) → 0

There are also 2 hidden tests you can't see. Solve the problem, not the examples.