Consider the partially-filled array named a. What does the following loop do? (cin is a Scanner object)

int[] a = {1, 3, 7, 0, 0, 0};
int size = 3, capacity = 6;

int value = cin.nextInt();
while (size < capacity && value > 0)
{
a[size] = value;
size++;

1. Reads one value and places it in the remaining three unused spaces in a.
2. Reads up to 3 values and places them in the array in the unused space.
3. Reads up to 3 values and inserts them in the array in the correct position.
4. Crashes at runtime because it tries to write beyond the array.