One of the great features of any programming language is the ability to repeat blocks of code, sometimes indefinately, sometimes until a certain condition is met, or for a set number of iterations. Luckily, Java comes with several flavours of loops, let have a brief look at our options The “for” loop – The for […]
Tag: while
Just another bitesize SCJP post here, looking at the while loop in Java. There may be times, where you need to continually iterate over a code block for an unknown number of times. What you can do, is to loop through a code block while a condition is true, something else might change that condition, […]