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

Pages: 1
Anonymous
Unregistered




"final" allowed
      #31722 - 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  
Pages: 1



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

Moderator:   

Print Topic

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

Rating:
Topic views: 3120

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5