Java Boolean Statements

Quiz
•
Computers
•
11th Grade
•
Easy
Michelle Reckling
Used 32+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of boolean statements in Java?
To perform arithmetic calculations
To compare values and determine their relationship
To print output on the console
To create loops and iterations
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator is used to check if two values are equal in Java?
==
<=
>=
>
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following boolean expression in Java:
System.out.println(6 > 3) ?
true
false
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following boolean expression in Java: !(4 == 4)?
true
false
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you write a boolean expression to check if a variable "age" is greater than or equal to 18 in Java?
age >= 18
age <= 18
age == 18
age > 18
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you write an if-else statement in Java to check if a number is positive or negative?
if (num >= 0)
{ "+"
}
else { "-"
}
if (num <= 0)
{ "+"
}
else { "-"
}
if (num == 0)
{"+"
}
else { "-"
}
if (num < 0)
{ "+"
}
else { "-"
}
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to declare a boolean variable in Java?
boolean isTrue = 1;
boolean isTrue = 'true';
boolean isTrue = true;
boolean isTrue = '1';
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Java 1

Quiz
•
11th Grade
11 questions
Project STEM AP CS A Unit 1 Quiz Review

Quiz
•
9th - 12th Grade
15 questions
JavaScript and Graphics

Quiz
•
9th - 12th Grade
15 questions
Soal Java

Quiz
•
11th Grade - University
15 questions
Java Variables, Input and Output

Quiz
•
10th - 12th Grade
10 questions
APCSA - Unit 3

Quiz
•
9th - 12th Grade
11 questions
[Java] Review of User Input & Basic Arithmetic Operators

Quiz
•
9th - 12th Grade
10 questions
W8-11

Quiz
•
10th - 11th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade