Meaningless Drivel is fun!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Use Of Continue in do While Loop 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 "Use Of Continue in do While Loop" Watch "Use Of Continue in do While Loop" New topic

Use Of Continue in do While Loop

Aniruddha Jadhao

Joined: May 10, 2006
Posts: 24
is there no use of continue in do While loop?

please look in following code

public class Continue {

public static void main(String [] a){
boolean flag =true;
int i=0;
flag= false;
flag = i<10;

continue;//here with it/with out the same out put

S Thiyanesh
Ranch Hand

Joined: Mar 19, 2006
Posts: 142
A continue statement will always check the condition in loops and proceeds the next iteration.
In your example, the continue statement will not bypass the loop condition.


Hope this one does the purpose of printing only the values of i >= 5 and i <= 10
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Use Of Continue in do While Loop
It's not a secret anymore!