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 the purpose of a for loop in Java?
Think about loops that have a pre-defined number of iterations.
What type of loop would you use when you do not know the number of iterations beforehand?
Remember the loop that checks before running.
When would you use a for loop?
Recall the structure involving initialization, condition, and update.
True or False: A while loop guarantees that the loop body will execute at least once.
Think about how a while loop evaluates its condition.
Write a program using a nested for loop that prints out a multiplication table for numbers 1 through 5.
Consider how to iterate through both the rows and columns of the table.
Using a while loop, create a simple password check that continues to prompt a user until they enter the correct password.
Think about how your condition checks the input against the correct password.
6 more questions in this section. Enroll free to practise them all.
Enroll free