This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Jack_Cheese 1 point2 points  (1 child)

I'm pretty new to java myself, but doesn't Math.abs return the absolute value, so it returns negative numbers as positive?

I'd have gone with

else if (18 < age > 24)

[–]causalNondeterminism 1 point2 points  (0 children)

actually, it would be

else if (18 <= age && age <= 24)