labeled for loop in java
//WithLabelledLoop.java
class WithLabelledLoop
{
public static void main(String args[])
{
int i,j;
loop1: for(i=1;i<=10;i++)
{
System.out.println();
loop2: for(j=1;j<=10;j++)
{
System.out.print(j + " ");
if(j==5)
break loop1; //Statement 1
}
}
}
}
Output :
1 2 3 4 5
Also in Java:
- creating thread in java example
- java string to uuid
- enum with numbers java
- system.arraycopy java
- find the triplet sum in java linked list
- jackson ignore values if empty
- java binary tree
- esponente in java
- filter in list by time java
- how to initialize an array in java
- how to open a text file in java
- check if optional is empty java
- how to read in a file in java
- how to remove all special characters from a string in java
- Java array multidimensional hashcode
- java create folder
- arraylist in java
- how do i print text in java
- enhanced for loop java
- how to create array of linkedlist in java
- number to string java
- java localdate subtract two dates
- how to import jframe in java
- how to check if a string is in alphabetical order in java