Hoping for something more elegant than
if (i>0 && i<100)
This guy made a nice Range class.
Its use however will not yield nice code as it's a generic class. You'd have to type something like:
if (new Range(0, 100).contains(i))
or (somewhat better if you implement first):
class IntRange extends Range
....
if (new IntRange(0,100).contains(i))
Semantically both are IMHO nicer than what Java offers by default, but the memory overhead, performance degradation and more typing overall are hadly worth it. Personally, I like mdma's approach better.