Hi, I have a question about labelled break.
mainloop: for(int i = 0; i < array.length; i++){
for(int j = 0; j < array[i].length; j++){
if(array[i].secondArray[j]=='\u0000'){
break mainlooop;
}
}
}
does the flow of the program leaves the "j for loop" and go to the "i for loop" with i incremented? If that is the case, what's the difference between a labelled continue and a labelled break?
mainloop: for(int i = 0; i < array.length; i++){
for(int j = 0; j < array[i].length; j++){
if(array[i].secondArray[j]=='\u0000'){
continue mainlooop;
}
}
}
mainloop: for(int i = 0; i < array.length; i++){
for(int j = 0; j < array[i].length; j++){
if(array[i].secondArray[j]=='\u0000'){
break mainlooop;
}
}
}
does the flow of the program leaves the "j for loop" and go to the "i for loop" with i incremented? If that is the case, what's the difference between a labelled continue and a labelled break?
mainloop: for(int i = 0; i < array.length; i++){
for(int j = 0; j < array[i].length; j++){
if(array[i].secondArray[j]=='\u0000'){
continue mainlooop;
}
}
}