I find a strange statement while reading the openjdk resources. enter image description here
what does the "found:{}" means?
I find a strange statement while reading the openjdk resources. enter image description here
what does the "found:{}" means?
found:{}
is a label in Java mainly used for goto
statement but since Java doesn't use goto
it can be used for break
and continue
statement. Here is an example of using a label in Java.
loop:
for (int i = 0; i < 10; i++) {
for(int j=0; j<10; j++)
{
if(j==5)
{
break loop;
}
System.out.println(j);
}
}
When j
reach 5 it will trigger break to outside loop
label.