44.8k views
3 votes
Syntax error, 'for each' statements are only available if source level is 1.5 or greater T/F

User Tzenderman
by
7.3k points

1 Answer

4 votes

True, the "for each" statement, also known as the "enhanced for loop," is only available in Java source level 1.5 or greater. This statement allows for more concise and efficient iteration through collections or arrays. If you try to use the "for each" statement in an earlier version, you may encounter a "content loaded syntax error" indicating that the language feature is not supported. Upgrading to Java 1.5 or later will enable the use of "for each" statements.

User James Fassett
by
6.7k points

No related questions found