java go to next iteration in while loop

java go to next iteration in while loop

Use the continue statement to end current iteration (skip the rest code of iteration ),
go to next iteration

refer to‮al:‬utturi.com
/**
 * @author lautturi.com
 * Java example: java continue statement in while loop
 */

import java.util.*;
import java.text.SimpleDateFormat;

public class Lautturi {

	public static void main(String[] args) {

		int i = 0;
		while (i<10){
			i++;
			if (i == 5){
		    	continue; 
		    }
			System.out.print(i + " ");
		}

	}
}
Created Time:2017-09-12 07:19:08  Author:lautturi