Java Foreach Loop

Java 5 introduced foreach loop, a much needed feature since it was first relaeased. Java foreach loop provides code simplicity, readability and eliminates the repetition of code that we write for type casting and assignments, when we are iterating arrays and collection objects.

When used with generics nothing is more apealing loop than foreach. I was reading an article “What Java foreach loop can do?“, which describes every thing a developer needs to know about for eachloop.

No Comment

No comments yet

Leave a reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word