adplus-dvertising
frame-decoration

Question

Which is the new method introduced in java 8 to iterate over a collection?

a.

for (String i : StringList)

b.

foreach (String i : StringList)

c.

StringList.forEach()

d.

List.for()

Posted under Java Programming

Answer: (c).StringList.forEach()

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which is the new method introduced in java 8 to iterate over a collection?