Check out example codes for "java for range loop". It will help you in understanding the concepts better.

Code Example 1

import java.util.stream.IntStream; 

IntStream.range(0, 3).forEachOrdered(n -> {
    System.out.println(n);
});

Learn ReactJs, React Native from akashmittal.com