Three Ways

To review, there are three ways of creating and initializing arrays.

// Manually
int[] integers = new int[3];
integers[0] = 2;
integers[1] = 4;
integers[2] = 6;
// Shortcut for declaring, creating, AND initializing
String[] names = {"Pat", "Terry", "Jan"};
// Shortcut for assigning or reassigning
String[] states = new String[] {"Alabama", "Arkansas"};

Prev -- Up -- Next