23-for-each loop + java

23-for-each loop + java

Professional Development

•

32 Qs

quiz-placeholder

Similar activities

ENGLISH QUIZ 1fase

ENGLISH QUIZ 1fase

7th Grade - Professional Development

•

28 Qs

Sports Week

Sports Week

Professional Development

•

28 Qs

Kelly Trainning time  2 proeficiency

Kelly Trainning time 2 proeficiency

Professional Development

•

29 Qs

Soccer

Soccer

Professional Development

•

29 Qs

Past simple irregular verbs

Past simple irregular verbs

3rd Grade - Professional Development

•

30 Qs

Receiving calls

Receiving calls

Professional Development

•

35 Qs

Tania EnglishNoil february

Tania EnglishNoil february

KG - Professional Development

•

27 Qs

PASSIVE | revision

PASSIVE | revision

Professional Development

•

27 Qs

23-for-each loop + java

23-for-each loop + java

Assessment

Quiz

•

English

•

Professional Development

•

Practice Problem

•

Hard

Created by

ANIL KUMAR

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

32 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is for loop and forEach loop?

for loop is used only for arrays, while forEach loop can be used for any collection
for loop can only iterate forward, while forEach loop can iterate forward and backward
for loop requires an index variable, while forEach loop does not
for loop is faster than forEach loop

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is forEach loop in Java explain with example?

for (int i = 0; i < arr.length; i++) {System.out.println(arr[i]);}
for (String str : list) {System.out.println(str);}
while (iterator.hasNext()) {System.out.println(iterator.next());}
do {System.out.println(str);} while (str != null);

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Is forEach loop only for arrays?

Yes
No

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What can forEach loops not do?

Modify the collection being iterated
Iterate through multiple collections at once
Break out of the loop early
None of the above

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Is for loop same as forEach?

Yes
No

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Is forEach faster than for Java?

Yes
No

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is for-each loop write the syntax of it?

for(i=0;i<arr.length;i++)
for(Object obj: arr)
for(i in arr)
for each(obj in arr)

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?