public class TestClass
{
public static void main(
String[] args)
{
String: for(int i = 0; i< 10; i++)
{
for (int j = 0; j< 10; j++)
{
if ( i+ j > 10 ) break String;
}
System.out.println( "hello");
}
}
}
I have 2 questions for this code from JQ+?
1. Why should this code compile if a keyword
String is used a label identifier in break.
2. Why the output should print
hello twice.
-Arun