- While continue is part of a long loop, refactor the loop using Extract Method refactoring
- Negate the condition before the continue statement
- Move the code below the continue statement to inside of the if block
public static void main( String[] args ) {
for ( int i = 0; i < args.length; i++ ) {
if ( i >= 5 ) {
System.out.println( args[ i ] );
}
}
}
|
|