Can a LABEL block be used without loop? Any examples?
Here is an example of using labels and break statements without a loop:
block1: {
if (a < 0) {
break block1;
}
if (b < 0) {
break block1;
}
return a + b;
}
public static void main(String[] args)
{
hello: break hello;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With