简体   繁体   中英

While loop error in java : ')' expected and ';' expected and not a statement ..

I am getting an error that says: ')' expected
not a statement
';' expected
not a statement

while(high=true, p>=10000,y-40;){
    p = p/2;

    }

A while loop must have a Boolean expression within the parentheses. For example high == true . I'm not exactly sure what you're trying to accomplish with comma separated list.

Your expression would then be high == true && p < 10000

Move the subtraction into the body of the loop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM