Sep 24, 2024
int x = 15;
int y = 10;
boolean z = x > y;
(results in true
because 15 is greater than 10)==
!=
<
>
<=
>=
int
, double
, boolean
, char
int heightInInches = readInt("What is your height?");
boolean canRide = heightInInches >= 50;
int grade = readInt("What was your grade?");
boolean gotB = (grade >= 80) && (grade < 90);
int grade = readInt("What was your grade?");
boolean gotB = (grade >= 80) && (grade < 90);
System.out.println("Got a B: " + gotB);
true
(B-grade)true
(B-grade, edge case)false
(not a B)false
(not a B)AND
(&&
) are used to combine comparison conditions.