Search Header Logo

Java while loops

Authored by Claire Firman

Computers

10th - 12th Grade

Used 17+ times

Java while loops
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

A while loop carries on as long as...

The condition in the brackets is true

The condition in the brackets is false

i < 10

the for loop has not ended

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

A while loop has the following format:

while (condition)

{

...

}

while

{

...

}

continue while (condition)

{

...

}

while [condition]

[

...;

]

3.

MULTIPLE SELECT QUESTION

45 sec • 5 pts

A condition in Javacould be any of the following:

a >, <, ==, >=, <= relation

str1.equals(str2)

str1.equalsIgnoreCase(str2)

str.length()

4.

MULTIPLE SELECT QUESTION

45 sec • 5 pts

While loops are used when ...

You are not sure how many times exactly a loop should iterate

You want a loop to repeat while the condition is true

You don't like for loops

You don't like to wait for things

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

OUTPUT?

int i = 1;

while (i < 5) {

System.out.println("Hello");

i++;

}

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

Hello

6.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

While loops are not really important or necessary in Java

True

False

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?