File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes switch and labeled break Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "switch and labeled break" Watch "switch and labeled break" New topic

switch and labeled break

Pawanpreet Singh
Ranch Hand

Joined: Jun 12, 2005
Posts: 264

I just want to know that can we use labeled switch as we use labled loops or a labeled body.

1) This is switch without label

2) switch with label, here break abc; statement should skip the default case also. The control should come out of swicth body but it comes out of for loop only. Please justify the both one.

[ August 27, 2005: Message edited by: Michael Ernest ]
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

You cannot break out of a case statement back to the original switch.

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: switch and labeled break
It's not a secret anymore!