About This Chapter
Loops in Java: Chapter Summary
This collection of Java tutorial lessons provides clear and straightforward instruction on the types of loops that are used in Java. The chapter covers the basics of while loops, do-while loops, for loops and more. You'll also see illustrative examples of these loops in action and learn about their syntax.
These lessons break down Java loop concepts into bite-sized chunks so you can easily follow and retain the information. After completing each lesson, you can make sure you fully understand the information by taking short multiple-choice quizzes.
These lesson go over several Java loop topics, including:
- For loops and nested for loops
- Syntax of while and do-while loops
- Nested while and infinite while loops
Java is a trademark of the Oracle Corporation, which is not affiliated with Study.com.
1. For Loops in Java: Syntax & Example
This lesson will cover for loops in Java. A for loop is a counting loop, because it repeats a set of instructions for a set number of times. For loops are useful when you know when the condition will be met.
2. Nested For Loops in Java
A loop within a loop: nested for loops in Java are a way to perform more complicated tasks and routines. In this lesson, we'll learn the syntax for nested loops and also look at some examples.
3. While Loops in Java: Example & Syntax
This lesson will cover the Java while statement, which loops through lines of code while a specific value or condition is true. While loops are very powerful, but they should be carefully developed and tested.
4. Do-While Loops in Java: Syntax & Example
Programming is about repetitive tasks: The Java Do-While loop is great for performing a specific set of instructions while a condition is true. In this lesson, we'll cover the syntax and provide some real-world code examples.
5. Nested While Loops in Java
How would you print out a chart to record scores for players in a basketball game? In Java, you can do this using a nested while loop. In this lesson, we'll explore how to use nested while loops in Java.
6. Infinite While Loops in Java
Infinity is a daunting concept, and in Java, an infinite loop can be a nightmare. In this lesson, we'll break down the concept of an infinite/unending loop in Java and provide examples and caveats.
Earning College Credit
Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.
To learn more, visit our Earning Credit Page
Transferring credit to the school of your choice
Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.
Other chapters within the Java Programming Tutorial & Training course