User Tools

Site Tools


java:control_structures:break

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

java:control_structures:break [2024/02/16 01:03] (current)
Line 1: Line 1:
 +====== break======
 +<code java>
 +break;
 +</code>
  
 +continiue breaks a loop at a given point and exit the loop
 +
 +
 +===== example of break in java =====
 +<code java>
 +package codereferececomjava;
 +
 +public class CodeRefereceComJava {
 +
 + 
 +    public static void main(String[] args) {
 +
 +        int i;
 +        for (i=42;i<=45;i++) {
 +            if (i==43) break;
 +            System.out.println("The answer is probably "+i);
 +        }
 + 
 +    }
 +}
 +
 +</code>
 +
 +=== output of break ===
 +    The answer is probably 42

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
java/control_structures/break.txt · Last modified: 2024/02/16 01:03 (external edit)

Impressum Datenschutz