Type a fixed-length int array declaration
Type a fixed-length int array declaration
Answer
int[] scores = new int[5];
Allocates five ints, all defaulting to 0. The length is fixed — scores.length is permanently 5.
Type a fixed-length int array declaration
Type a fixed-length int array declaration
Answer
int[] scores = new int[5];
Allocates five ints, all defaulting to 0. The length is fixed — scores.length is permanently 5.