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.
- Become CIW Master CIW Enterprise Developer certified.
- Click here to get free scbcd SCBCD exam practice questions.
- Pass SUN scdjws - SCDJWS
- Become SUN SCJA certified.
- Click here to download scjp test study guide and practice question.
- Download free practice test for SUN SCJP 5/6 exam.
- Click here to download scmad test study guide and practice question.
- Become SUN SCWCD certified.
- Pass SCJA in first attampt.
- Click here to get free CX310-055 Java 5.0 exam practice questions.
- Best exam simulation SUN CX310-056 download free trial.
- Best exam simulation SUN CX310-065 download free trial.
- Download free practice test for CX310-066 SCJP Upgrade exam.