Skip to main content

Loops

Learn Loops (Programming Concepts, Programming Fundamentals) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

What is Looping? Looping means repeating a block of code multiple times, instead of writing the same statement over and over by hand. It exists because many real problems require doing the same action for every item in a collection, or repeating a step until some condition is met. Without loops, printing "Hello" 5 times would need 5 separate print statements. With a loop, one statement does it.

More lessons in Programming Concepts