Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Practice for 10th AP Java quiz (old)

Total questions: 11

Worksheet time: 8mins

Name
Class
Date
1.

What is the output of this program?

a)

1

b)

2

c)

4

d)

ArrayIndexOutOfBoundsException

2.

What is the output of this program?

a)

2

b)

3

c)

4

d)

ArrayIndexOutOfBoundsException

3.

What is the output of this program?

a)

2

b)

3

c)

4

d)

ArrayIndexOutOfBoundsException

4.

What is the output of this program?

a)

2

b)

3

c)

4

d)

ArrayIndexOutOfBoundsException

5.

Which of the functions is a correct recursive factorial function?

a)

A only

b)

B only

c)

C only

d)

A, B and C

6.

Which call to mystery would cause infinite recursion?

a)

mystery(1,2)

b)

mystery(2,2)

c)

mystery(3,2)

d)

none of these would cause infinite recursion

7.

Which of the functions is a correct recursive triangular number function?

a)

A only

b)

B only

c)

C only

d)

A, B and C

8.

What is returned by the call mystery(1,1)?

a)

5

b)

6

c)

7

d)

Stack Overflow

9.

What is returned by the call mystery(3)?

a)

zy

b)

zyz

c)

yzy

d)

zyyzy

10.

What is returned by the call mystery(3,3)?

a)

5

b)

6

c)

7

d)

Stack Overflow

11.

Which best matches contents of aRay after the following program has executed?

a)

A

b)

B

c)

C

d)

None of these matches