In chapter 4 Java 11 book, below code snippet is given :
#Code
Public class sample
{
Public static void main(String args[])
{
int[][] list ={{1,13},{5,2},{2,2}};
int search=2;
Int positionX =-1;
Int position Y=-1;
Parent_loop:
for(int i=0; i<llist.length;i++)
{
for (int j=0, j<list.length;j++)
{
If(list[i][j]=search
{
position X=i;
position Y=j;
Break parent_lopp;
}}}
If(positionX==-1|| positionY==-1)
{
Sop ("value not found );
}
else
{
Sop("Value found at +position X, position Y);
}}}
The explanation states for the labelled break output would be 1,1
If it is normal break statement, the value is 2,0
I'm not able to understand how 2,0 is occurring?? Please explain
Also, let me know what will be the answer if the labelled break was replaced by Continue statement