Java while loops (JNNC Technologies)


Java while loops statement allows to repeatedly run the same block of code, until a condition is met.
while loop is most basic loop in Java. It has one control condition, and executes as long the condition is true. The condition of the loop is tested before the body of the loop is executed, hence it is called an entry-controlled loop.
The basic format of while loop statement is:
While (condition)
{
   statement(s);
   Incrementation;
}
Figure – Flowchart of while loop:
java-while

0 Comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();