23-for-each loop + java

23-for-each loop + java

Professional Development

32 Qs

quiz-placeholder

Similar activities

REVIEW B04

REVIEW B04

1st Grade - Professional Development

30 Qs

English Language Quiz

English Language Quiz

6th Grade - Professional Development

30 Qs

Flight Attendants Vocabulary 1

Flight Attendants Vocabulary 1

Professional Development

27 Qs

Office Equipment

Office Equipment

Professional Development

35 Qs

Acronyms and Abbreviations

Acronyms and Abbreviations

KG - Professional Development

35 Qs

High Note 2 Unit 8 Test

High Note 2 Unit 8 Test

Professional Development

28 Qs

Basic 1 - Unit 5 Lesson B

Basic 1 - Unit 5 Lesson B

Professional Development

28 Qs

collocations L 123

collocations L 123

Professional Development

29 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?