Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 958924

Anonymous
Unregistered




"final" allowed
      05/08/06 01:25 AM

Surprisingly enough you can use final while declaring your
iteration local variable. Like...
Code:

for(final AType aLoopVar : anArrayOfAType) {
...
}




This shows this new construct is just syntax sugar for:
Code:

for(int _index = 0; _index < anArray.length; _index++ ) {
final AType aLoopVar = anArrayOfAType[_index];
...
}



Post Extras Print Post   Remind Me!     Notify Moderator


Entire topic
Subject Posted by Posted on
* "final" allowed Anonymous 05/08/06 01:25 AM

Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   



Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 3104

Rate this thread

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5