Java and do while

I have a java code that works properly. I want to add a loop within the code, but I am not familiar with Java.

A lotusscript version of what I want to do would look something like this:

Dim x as integer

x = 1

Do While x <= 5

'Some code

x = x + 1

loop

I’m not sure how to declare my integer variable (x in the above statement) or the syntax of the Loop statement.

Can anyone point me in the right direction?

Regards,

-Jeremy

Subject: java and do while

Translated literally into Java, it would look something like this:

int x = 1;

while (x <= 5) {

//some code	

x = x + 1;

}

or you can use a for loop like this:

for(int x=1; x <=5; x++) {

//some code

}

Hope that helps.