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 doubt pg 340 of k&b 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 "doubt pg 340 of k&b" Watch "doubt pg 340 of k&b" New topic

doubt pg 340 of k&b

harinath chakrapani
Ranch Hand

Joined: Jun 11, 2007
Posts: 40
the wordings are:
The enhanced for loop asumes that, barring an early exit from the loop, you'll always loop throught every element of the array. The following discussions of break and continue appy to both the basic and enhanced for loops.

i cant understand this.
any one please explain. thanks in advance

Harinath chakrapani
Manfred Klug
Ranch Hand

Joined: Jun 04, 2007
Posts: 377
Hi harinath,

the following enhanced for loop

is basically something like this:
Sridher Reddy

Joined: Mar 27, 2007
Posts: 8
to add to Manfred's explaination...
what the line also means is that, the "enhanced for loop" and the "basic for loop", both will continue to work the way mentioned above unless they encounter any of the
System.exit(0); or break; or continue; statements.

_ ______________________________ _ <br />I'm using jdk1.5.0_12
I agree. Here's the link:
subject: doubt pg 340 of k&b
It's not a secret anymore!