Relational & Logical Operators QuizS2C Home « Relational & Logical Operators Quiz
Fundamentals Quiz 7
The quiz below tests your knowledge of the material learnt in Fundamentals - Lesson 8 - Relational & Logical Operators.
Question 1 : What values do
a
and b
hold after the following expressions?boolean a = true;boolean b = false;if (a | b) {System.out.println(true);}
- The <code>|</code> logical operator checks both <code>a</code> and <code>b</code> for <code>true</code> and so the answer is <code>true</code> as <code>b</code> is <code>true</code>.
Quiz Progress Bar
Quiz 1
Code Structure & Syntax

Quiz 2
Java Variables

Quiz 3
Primitives - boolean
& char
data types

Quiz 4
Primitives - Numeric data types

Quiz 5
Method Scope

Quiz 6
Arithmetic Operators

Quiz 8
Assignment Operators

Quiz 9
Bitwise Logical Operators

Quiz 10
Bitwise Shift Operators

Quiz 11
if
Construct

Quiz 12
switch
Construct

Quiz 13
for
Construct

Quiz 14
while
Construct

What's Next?
The next quiz on Java is all about Assignment Operators.