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 do...while() statement question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "do...while() statement question" Watch "do...while() statement question" New topic

do...while() statement question

zheng li
Ranch Hand

Joined: Jun 16, 2009
Posts: 56

why while(w < 1) can be put directly after do?
what else can be put there?
Ankit Garg

Joined: Aug 03, 2008
Posts: 9326

This is how the program actually works

Remember, that while in a do-while is followed by a semicolon...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
zheng li
Ranch Hand

Joined: Jun 16, 2009
Posts: 56
thank you.
It is sorta covered in the JavaRanch Style Guide.
subject: do...while() statement question