JMU
Relational Operators
An Introduction with Examples in Java


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Review
Going Further: Operator Notations
Going Further: Operator Notations (cont.)
Relational Operators
Relational Operators in Java
Examples of Expressions Involving Relational Operators in Java
Operands of Relational Operators in Java
Relational Operators with boolean Operands
Relational Operators with boolean Operands (cont.)
Combining Relational and Logical Operators
Gaining Experience Combining Relational and Logical Operators

Which of the following expressions are syntactically correct?

a > 0 && < 100

10 < 63 < 105

10 < 63 && 10 < 105
  
Gaining Experience Combining Relational and Logical Operators (cont.)

Which of the following assignment statements are syntactically correct?

boolean    a, b;
int        i, j;

a = i < j;
b = a && b;
i = i + j;
i = i < j;
b = a && ((i == j) || (i > j));