Professional Documents
Culture Documents
LOOPS IN
JAVA
SUBMITTED BY:
JUSTINE O. DE GUZMAN
BSCPE4B
SUBMITTED TO:
MR. LOUIEVIC SANCON
I. INTRODUCTION
In programming, being concise and having a code that can be understood and can clearly
be read is an advantage, this is due to the reason that having a code like this gives an
opportunity to easily debug and know how the program works. This can also be achieved
by shortening a code. A method called loop can do this work for you. A loop can make a
allows the programmer to write the code once and repeat it as many times as needed.
methods for running loops. While all of the methods provide comparable basic
While loop begins checking the Boolean condition, when true, the loop is executed.
provides a shorter and way easier to debug structure by consuming the initialization,
Similar to while loops but in this loop it checks condition after executing the
Fig3. Nested do while loop Fig4. Nested while and for loop
A nested loop is a loop that is inside another loop and these are the different
combinations of a nested loop
IV. DISADVANTAGES OF LOOPS
V. CONCLUSION
Therefor I can conclude that using loops in java provides a code that is shorter and
makes a code more concise. I can also conclude that there are still pitfalls in a loop and
therefore we as a programmer still needs to be more careful in using loops to ensure that
our code runs smoothly and without any errors just like in the infinite loops error that could