We all know about intervals in mathematics (e.g -4 < x < 3).
How can I represent these mathematic intervals in Java, e.g, the numbers between -4 and 3 (-4, -3, …, 2, 3 etc)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check apache commons-lang
IntRange. So, if you want to check if a number is in a given interval (range), you do: