Continue

La instrucción continue sirve para transferir el control del programa desde la instrucción continue directamente a la cabecera del bucle (for, do-while o while) donde se encuentre.

Veamos un ejemplo para tenerlo más claro:

public class continue_while {
  public static void main(String[] args) {
    int i=0;
        
    while (i<10){
        System.out.println("i="+i);
        i++;
        continue;
    }    
  }
}

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options