Page 1 of 1

qid: enthuware.ocajp.i.v8.2.1010

Posted: Thu Feb 03, 2022 9:22 am
by Amit_Tiwari
The explanation of the answer says below

String String = ""; //This is valid. // This ok for me - Amit
String : for(int i = 0; i< 10; i++) //This is valid too! // This is giving compile time error
{
for (int j = 0; j< 10; j++){
if ( i+ j > 10 ) break String;
}
System.out.println( "hello");
}

I am getting issue with 'String' label, It is giving me compile time error

Re: qid: enthuware.ocajp.i.v8.2.1010

Posted: Thu Feb 03, 2022 10:25 am
by admin
You must be making a mistake. Copy paste the code and compile it from command line. It will compile fine.