Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: !done

  1. #1
    Banned
    Join Date
    Sep 2009
    Location
    atlanta
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    !done

    what does this mean...

    while (!done)
    {}

    what does the !done mean?
    thanks

  • #2
    Regular Coder cs_student's Avatar
    Join Date
    Oct 2009
    Location
    ~/
    Posts
    195
    Thanks
    2
    Thanked 22 Times in 22 Posts
    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.


    Code:
    done = true;
    if(done) System.out.println("done == true");
    if(!done) System.out.println("evaluated to false and won't prinnt");

  • #3
    Regular Coder
    Join Date
    Dec 2007
    Posts
    107
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Is it infinite loop? if not then it must be some Boolean variable whose value is set before using it in the while loop.
    Programming & Webmaster Forum - AdSense Revenue Sharing forum

  • #4
    Banned
    Join Date
    Sep 2009
    Location
    atlanta
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks. that helps.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •