NEW
Font size
WorksheetsJava Arrays and Loops Quiz Review
Total questions: 15
Worksheet time: 7mins
Array indices start with what number?
0
1
-1
NaN
Which of the below is NOT a loop?
for
while
do-while
repeat
A for loop is what kind of loop?
definite
indefinite
initial
continuous
A while loop is what kind of loop?
definite
indefinite
initial
continuous
A for loop executes a specific number of times and a while loop executes until a condition is met.
Seems legit
Not buying it
A do-while loop executes at least once and a while loop may not execute at all.
You betcha!
Nah
For an array, the statement print(array[4]) will print the fourth element of the array.
Fake news!
Yes, yes, a thousand times yes!
Arrays use adjacent memory locations to store information. This makes them _______ than other data structures.
faster
slower
more complex
larger
If you have a list of 20 items to process, which loop should you use?
for
while
do-while
loopity-loop
If you are collecting information from an unknown number of people, which loop should you use?
for
while
fruit
donor
An array can have more than one data type stored in its elements.
How about no?
Totally!
Once declared, an array in Java can not change in size.
True story
Fake news
You must access array elements in order (first element, then the second, etc.).
True dat
Nuh uh
You can implement a while loop as a for loop with the use of the "break" command.
Sure
Nope
There are three (main) types of loops.
True
False
