'Best way to Iterate over a range of Integers in Java without regex [closed]

I have range of numbers 08230 to 08239. I would like to iterate over this numbers and find numbers like 0823021267 or 0823121267 etc. I tried regex that works fine. Is there other way (better way) to do that and how please with example.



Solution 1:[1]

int min_range = 8230;
int max_range = 8239;


for(int i = min_range * 100000; i < max_range * 100000; ++i)
    System.out.println(i);

... if i understood what you meant correctly.
I would also want to ask someone with more knowledge whether the max_range * 100000 would be considered as loop invariant by javac and pulled out of the loop.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 piezol