wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Arrays and Loops Quiz Review

Total questions: 15

Worksheet time: 7mins

Name
Class
Date
1.

Array indices start with what number?

a)

0

b)

1

c)

-1

d)

NaN

2.

Which of the below is NOT a loop?

a)

for

b)

while

c)

do-while

d)

repeat

3.

A for loop is what kind of loop?

a)

definite

b)

indefinite

c)

initial

d)

continuous

4.

A while loop is what kind of loop?

a)

definite

b)

indefinite

c)

initial

d)

continuous

5.

A for loop executes a specific number of times and a while loop executes until a condition is met.

a)

Seems legit

b)

Not buying it

6.

A do-while loop executes at least once and a while loop may not execute at all.

a)

You betcha!

b)

Nah

7.

For an array, the statement print(array[4]) will print the fourth element of the array.

a)

Fake news!

b)

Yes, yes, a thousand times yes!

8.

Arrays use adjacent memory locations to store information. This makes them _______ than other data structures.

a)

faster

b)

slower

c)

more complex

d)

larger

9.

If you have a list of 20 items to process, which loop should you use?

a)

for

b)

while

c)

do-while

d)

loopity-loop

10.

If you are collecting information from an unknown number of people, which loop should you use?

a)

for

b)

while

c)

fruit

d)

donor

11.

An array can have more than one data type stored in its elements.

a)

How about no?

b)

Totally!

12.

Once declared, an array in Java can not change in size.

a)

True story

b)

Fake news

13.

You must access array elements in order (first element, then the second, etc.).

a)

True dat

b)

Nuh uh

14.

You can implement a while loop as a for loop with the use of the "break" command.

a)

Sure

b)

Nope

15.

There are three (main) types of loops.

a)

True

b)

False