Skip to main content

Practice · 2 of 4

Between two bounds

CHALLENGE
Difficulty: beginner+25 XP

Implement boolean inRange(int x, int lo, int hi): true when lo <= x AND x <= hi. Java has no lo <= x <= hi chain — you must combine two comparisons with &&.

Back to lesson: Practice: Evaluate everything