6
AssignmentMultiple Choice

Project: Using Loops in a Guessing Game

Question 6 • ASC Programming, Games, Apps and Society

How do the statements below differ in purpose? Statement A: int[ ] trainArray; Statement B: trainArray = new int [10];

Answer
A
Statement A defines the size of the array, and Statement B declares the array in memory.
B
Statement A declares the array in memory, and Statement B defines the size of the array.
C
Statement A declares the array in memory, and Statement B declares the array as 10 integers.
D
Statement A declares the array as 10 integers, and Statement B declares the array in memory.
Previous
Next