Confused on something

0 Shaheedul Islam · July 30, 2015
While I was watching some other tutorials, I saw this many times.
The person would initialize a  boolean variable as false. They would then create a while loop with this as it;s condition:

boolean done = false;
while(!done)
{
      //Body of loop
}

Can someone explain to me what !done means??

Post a Reply

Replies

Oldest  Newest  Rating
+1 Ji Si · July 30, 2015
done is initialize as false first.

then !done means this is true. So Simply the while loop is saying if it is true, then execute the body of the loop inside. if false, then don't. 

hope it helps. Thanks
0 Kuroodo Ditory · July 31, 2015
Yeah what Ji said.

In English, the code says:

While done is false, continue looping.
  • 1

Java / Android Development

107,325 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator