View Full Version : !done
etidd
10-26-2009, 03:34 AM
what does this mean...
while (!done)
{}
what does the !done mean?
thanks
cs_student
10-26-2009, 03:48 AM
I would assume that done is a boolean variable.
The statement you have created is a while loop which will loop checking each time if the conditional evaluates to true. In the case you provided the conditional would be the opposite of the value 'done', due to the '!' not operator.
done = true;
if(done) System.out.println("done == true");
if(!done) System.out.println("evaluated to false and won't prinnt");
technica
10-26-2009, 09:34 AM
Is it infinite loop? if not then it must be some Boolean variable whose value is set before using it in the while loop.
etidd
10-26-2009, 05:51 PM
thanks. that helps.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.