wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Quiz 4: Booleans and Conditional Statements

Total questions: 7

Worksheet time: 21mins

Name
Class
Date
1.

Booleans can have values of yes and no.

a)

True

b)

False

2.

When using the && operator the statement will evaluate to true when:

a)

One and ONLY one statement is true

b)

Both statements are true

c)

No statements are true

d)

None of these

3.

When using the || operator the statement will evaluate to true when:

a)

One and ONLY one statement is true

b)

One or both statements are true

c)

Both statements are true

d)

All of these

4.

In Java an if statement is a conditional statement, meaning it sometimes does not run.

a)

True

b)

False

5.

An else statement can run after its preceding if statement runs.

a)

True

b)

False

6.

Switch statements allow for multiple branches of execution.

a)

True

b)

False

7.

! is as a NOT modifier.

a)

True

b)

False