iteration

B

bob

What's the name of this type of iteration in Java?

for (Player p : players)
{

}

I haven't seen this until recently.
 
R

Roedy Green

What's the name of this type of iteration in Java?

for (Player p : players)
{

I call it "for each"
--
Roedy Green Canadian Mind Products
http://mindprod.com
Programmers love to create simplified replacements for HTML.
They forget that the simplest language is the one you
already know. They also forget that their simple little
markup language will bit by bit become even more convoluted
and complicated than HTML because of the unplanned way it grows.
..
 
A

Arne Vajhøj

What's the name of this type of iteration in Java?

for (Player p : players)
{

}

I haven't seen this until recently.

It came with Java 1.5 in 2004.

:)

It is usually called "for each" or "enhanced for".

I sometimes call it "new for".

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top