Java Exam

Java Exam

Assessment

Quiz

11th Grade

Practice Problem

Medium

Used 5+ times

FREE Resource

Student preview

quiz-placeholder

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct for loop?

for(int i = 0; i < 3; i++);

for(i = 0 < 3; i++);

for int i = 0; i < 3; i++

for(int i = 0; i < 3; i++)

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does this code print

for (int i = 3; i < 8; i++)

{

System.out.print(i + " ");

}

4 5 6 7 8

3 4 5 6 7

2 3 4 5 6

3 4 6 7 5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this code print?

for (int i = 3; i <= 9; i++)

{

System.out.print("*");

}

8

11

3

7

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

for (int i=1; i<30; i = i + 3)

{

if (i%2 == 0) System.out.print((i/2)+" ");

}

System.out.println();

6 3 4 7 11

5 6 9 1 5

2 5 8 11 14

8 9 16 0 9

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

for (int i=5; i>0; i--)

{

for (int j=0; j<i; j++)

System.out.print((2*i-j)+" ");

System.out.println();

}

9 3 4 5 6

2 3 4 5

2 3 4

2 3

2

6 7 8 9 10

6 7 8 9

7 8 9

8 9

10 9 8 7 6

8 7 6 5

6 5 4

4 3

2

9 8 7 6 6

9 8 7 6

9 8 6

9 8

9

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

var i = 0;

while (i < 3) {

println("hi");

i++;

}

hi hi hi

hi

hi

hi

hi

hihihi

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

var i = 0;

while (i < 3) {

println("hi");

i++;

}

println("ant");

hi

ant

hihihi

hi hi hi ant

hi

hi

hi

ant

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?