~/ learn/ java-from-zero/ cards/ Declaring, instantiating & initializing arrays
1 of 4

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.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/e5b5d7b5-0da2-43fc-a3dc-0d88be881a61/flashcard utf-8 LF