File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enhanced for loop - new to Java 5 or Java 6?

 
Dave McQueen
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm rereading parts of the SCJP study guide for Java 6 book by Bert Bates and Kathy Sierra but am confused about something:- the book says that 'As of Java 6, the for loop took on a second structure'. Wasn't the enhanced for loop new to Java 5 and not 6? I'm reading all over the web that this is the case, so is this just a typo (page 345 beginning of paragraph Using For Loops)?
As usual, your help is appreciated,
Dave
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. The enhanced for loop was introduced in Java 5.
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This mistake has been reported before and soon there will be an errata for this and other such errors...
 
Harikrishna Gorrepati
Ranch Hand
Posts: 423
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Java 5, We have Enhanced For Loop
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic