While Loops in Java: Example & Syntax


Choose an answer and hit 'next'. You will receive your score and answers at the end.

question 1 of 3

A while loop runs code as long as the condition(s) is/are:

Create Your Account To Take This Quiz

As a member, you'll also get unlimited access to over 79,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-free
Try it risk-free for 30 days. Cancel anytime
Already registered? Log in here for access

1. What will be the result of the following code?

2. A while loop is considered _____ if you don't know when the condition will be true

Create your account to access this entire worksheet
A Premium account gives you access to all lesson, practice exams, quizzes & worksheets
Access to all video lessons
Quizzes, practice exams & worksheets
Certificate of Completion
Access to instructors
Create an account to get started Create Account

About This Quiz & Worksheet

See what you know about while loops in Java with this worksheet/quiz. Answer questions on areas of study like how long a while loop runs code and the result of a given code.

Quiz & Worksheet Goals

You'll be quizzed on these topics:

  • How to define a while loop
  • The syntax for a while loop
  • How while loops evaluate conditions

Skills Practiced

  • Knowledge application - use your knowledge to answer questions about how while loops run code and how it ends up
  • Reading comprehension - ensure that you can draw the most important information from the related lesson on while loops in Java
  • Information recall - access the knowledge you've gained regarding the syntax for a while loop that is correct

Additional Learning

For more on the topic, review the lesson called While Loops in Java: Example & Syntax. These areas will be covered:

  • What a while loop is
  • A while statement and how it's used
  • What a condition is and how it utilizes a boolean
  • Examples of a while loop
  • What a 'for' statement is