Java Conditions and If Statements

Java Conditions and If Statements

10th Grade

10 Qs

quiz-placeholder

Similar activities

APCSA Unit 6.2

APCSA Unit 6.2

10th - 12th Grade

14 Qs

AP Computer Science Principles Arrays

AP Computer Science Principles Arrays

10th - 12th Grade

14 Qs

AP CSA Unit 6 Arrays

AP CSA Unit 6 Arrays

10th - 12th Grade

14 Qs

Arrays Unit

Arrays Unit

10th - 12th Grade

14 Qs

Информатика by timoxa.666

Информатика by timoxa.666

9th - 12th Grade

10 Qs

Basic Programming

Basic Programming

10th Grade

10 Qs

Bab 1.4.2 - Operator Hubungan dan Operator Logikal dlm Struktur

Bab 1.4.2 - Operator Hubungan dan Operator Logikal dlm Struktur

9th - 12th Grade

12 Qs

APCSA Unit 6

APCSA Unit 6

10th - 12th Grade

14 Qs

Java Conditions and If Statements

Java Conditions and If Statements

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Myra Ungriano

Used 15+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?