| Author |
label
|
Sireesha Mullapudi
Ranch Hand
Joined: Jun 26, 2006
Posts: 74
|
|
Hi, Why this is not giving compile time error. here the label is not placed before any loop Thanks SCJP1.4
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
A label can appear before other statements too. You don't have to put it at the beginning of a loop.
|
 |
Burkhard Hassel
Ranch Hand
Joined: Aug 25, 2006
Posts: 1274
|
|
Hi all, I added JOHN as well: I think, break JACK; is ok, because JACK belongs to the while loop. both break JILL; and break JOHN; won't compile. Yours, Bu.
|
 |
prashanth kumar
Ranch Hand
Joined: Mar 22, 2004
Posts: 162
|
|
>>I think, break JACK; is ok, because JACK belongs to the while loop. >>both break JILL; and break JOHN; won't compile. I tried this code and everything will compile...The compiler will throw an error only when a reference is made to a label with a BREAK statement. Else the code will compile even though LABEL is placed in NON-LOOP places. Rgds Prashanth
|
SCJP1.5(86%)<br />SCWCD1.4(95%)<br />SCBCD1.3(92%)<br />IBM 252
|
 |
 |
|
|
subject: label
|
|
|