9
AssignmentMultiple Choice

Arrays–Passing by Reference

Question 9 • ASC Programming, Games, Apps and Society

What would you recommend, given the scenario below? Situation: You are a programmer, and you need to create an array in Java using the most efficient method. Which of the following possibilities of declaring an array is best?

Answer
A
while loop syntax
B
do While loop syntax
C
int[] trainArray = new int[10];
D
int trainArray[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
Previous
Next
What would you recommend, given the scenario…