7
AssignmentMultiple Choice

Arrays–Passing by Reference

Question 7 • ASC Programming, Games, Apps and Society

Why would you choose: int trainArray[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100 }; instead of int[] trainArray = new int[10]; when you declare an array of a certain data type and size?

Answer
A
This would never be a possibility.
B
to compile code
C
because this approach requires much less code
D
only when the code requires math
Previous
Next