Example

public static void main( String[] args ) {
for ( int i = 0; i < args.length; i++ ) {
System.out.println( args[ i ] );
i = i + 1;
}
}


Solution
Move the assignment-to-control variable from inside of the for loop to the increment clause of the loop.

public static void main( String[] args ) {
for ( int i = 0; i < args.length; i = i + 2 ) {
System.out.println( args[ i ] );
}
}

Solution
Change the for loop to a while loop

public static void main( String[] args ) {
int i = 0;
while ( i < args.length ) {
System.out.println( args[ i ] );
i = i + 2;
}
}