File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes label Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "label" Watch "label" New topic
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: 2367
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: label
 
Similar Threads
WA #1.....word association
If construct?
labelled break
switch statement question
Labels