Search Header Logo

Java Conditions and If Statements

Authored by Myra Ungriano

Computers

10th Grade

Used 18+ times

Java Conditions and If Statements
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is not included in Java Conditional statements?

if

else

else if

switch

none

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which conditional statement is used to specify a block of code to be executed if a specified condition is false?

if

else

else if

switch

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax to check if a variable 'x' is greater than 10 in Java?

if x > 10

if x >= 10

if x < 10

if x <= 10

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a comparison operator in Java?

==

<=

&&

!=

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When should you use the else if statement in Java?

To specify a block of code to be executed if a specified condition is true.

To specify many alternative blocks of code to be executed.

To specify a new condition to test, if the first condition is false.

To specify a block of code to be executed if the same condition is false.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for a switch statement in Java?

switch { }

switch (expression) { }

switch expression { }

switch (expression) { case: }

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which conditional statement would you use to specify many alternative blocks of code to be executed?

if

else

else if

switch

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?