A for-each loop is an enhanced for loop. It used to iterate over arrays and collections. This feature was added to Java to make the access and retrieval of elements of arrays and collections faster. The syntax of a for-each loop is as follows:
{
}
where, itrvar is the variable that iterates through the elements of the collection.
- Pass Master CIW Enterprise Developer in first attampt.
- Become SUN SCBCD certified.
- Click here to download scdjws test study guide and practice question.
- Click here to download scja test study guide and practice question.
- Pass SCJP in first attampt.
- Best exam simulation SUN scjp-5-0 download free trial.
- Click here to download scmad test study guide and practice question.
- Click here to get free scwcd SCWCD exam practice questions.
- Get certified in first attempt download CX310-019 - SCJA simulation.
- Pass SUN CX310-055 - Java 5.0
- Pass SUN CX310-056 - SCJP 5.0 Java Upgrade
- Become SUN SCJP 6.0 certified.
- Get certified in first attempt download CX310-066 - SCJP Upgrade simulation.