Check out example codes for "java for increment by 2". It will help you in understanding the concepts better.

Code Example 1

int n = 2; //Or any other number

for (int i=0; i < 10; i+=n){
	System.out.println(i) //This will print 0,2,4,6,8
}

Learn ReactJs, React Native from akashmittal.com