Multiple choice technology programming languages

push (@array, @sublist);

  1. splice (@array, 0, 1);

  2. splice (@array, @array-1, 1);

  3. splice (@array, scalar(@array), 0, @sublist);

  4. splice (@array, 0, 0, @sublist);

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

push appends @sublist to the end of @array. splice(@array, scalar(@array), 0, @sublist) inserts @sublist at position equal to the array's length (the end), without removing any elements (0 elements removed).

AI explanation

push appends elements to the end of an array, which is exactly what splice(@array, scalar(@array), 0, @sublist) does: it starts the splice at the current length of the array (i.e., past the last element), removes zero elements, and inserts @sublist there. Starting the splice at index 0 would insert at the front instead, and using @array-1 as the offset would insert one position before the end, overwriting the last element's position rather than appending after it.