Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

labelled break statement in Java

outer: for(int i = 0; i < 5; i++) {
  for(int j = 0; j < 20; j++) {
    System.out.print("*");
    brack outer;
  }
  System.out.println();
}

//this will only print one star 
 
PREVIOUS NEXT
Tagged: #labelled #break #statement #Java
ADD COMMENT
Topic
Name
8+3 =