Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is a nested loop?
Think about loops you already know.
Write a simple nested loop that prints the numbers 1-3 in a column format.
You can print the inner loop values in each iteration of the outer loop.
What is the main function of a nested loop?
Think about what a loop does.
True or False: The inner loop executes after the outer loop has completed.
Remember the order of execution.
Write a Java method that uses nested loops to create a multiplication table for numbers 1-5, stored in a 2D array. The method should also print out the table.
Think about how each element relates to its row and column.
Create a program to generate a checkerboard pattern using nested loops, representing black and white squares alternately. Each square can be a '#' and ' ' character.
You need to think about how to toggle colors.
5 more questions in this section. Enroll free to practise them all.
Enroll free