~/ 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/e17f6566-5fd0-4dc0-a6b0-8b23459362fb/flashcard utf-8 LF