Is there any way to use a range of numbers as a case value? For example, I need numbers 0 through 59 to perform the same operation. I know it would be easier to use an if statement, but the assignment calls for a switch. Is there any way to write it as:
public void range(int number) {
switch(number) {
case 0 - 59:
yadda yadda yadda
}
}
Rather than having to code it out case by case like:
public void range(int number) {
switch(number) {
case 0:
case 1:
blah blah blah
}
}
I have 100 values to go through in chunks of 10 (except for the 0 through 59). I'm guessing there's no way of doing it, but any help would be appreciated!