Question for the java challenged
Posted: Thu Mar 27, 2003 8:44 pm
Coming from C++, I have a question about loops. What's the syntax for the while loop. Eg.
given that is in C++, but I've seen someone use:
so I'm guessing there is a different syntax
similar question about a for loop. If i have:
it will go through a loop 10 times (or is it 11). Anyway, I'm just wondering how to translate those C++ snippits into java. They're two similar languages, but there are just a few small differences I'm finding.
Just a few little questions...
Code: Select all
var = 10;
while (var >= 0)
// do what i want
var --;
Code: Select all
while (1)similar question about a for loop. If i have:
Code: Select all
for (var = 10; var >= 0; var --)Just a few little questions...