This site requires JavaScript, please enable it in your browser!
Greenfoot back
gquach
gquach wrote ...

2013/3/19

how to successfully end a while loop?

gquach gquach

2013/3/19

#
i tried to end a while loop, but it doesn't end the way i wanted it for my next statements. how do u do it? please help...
Gevater_Tod4711 Gevater_Tod4711

2013/3/19

#
To end a while loop either the abort condition has to be false or you can end it using a break statement. You just have to write an if statement or anything else that checks whether the loop should stop and if so you just add a break; and the loop will stop.
You need to login to post a reply.