Thursday, June 19, 2008

-C-O-N-C-E-P-T- Series : Java

Enhanced for loop:

Code snippet:




Output of the program is:
4
0
0
3
0




Here, "i" is directly assigned the each value from array in each iteration.
Iteration 1: Value of i = 1 (arr[0])
Iteration 2: Value of i = 2 (arr[1])
Iteration 3: Value of i = 3 (arr[2])
Iteration 4: Value of i = 4 (arr[3])



The above diagram is self-explanatory. Really interesting concept & worth learning :)

2 comments:

Anonymous said...

can u leave ur phone number to me???

Anonymous said...

See you in these things, I think, I started feeling good!
Personalized Signature:贵州信息港休闲游戏中心,我爱掼蛋网,重庆游戏中心,金游世界视频棋牌游戏中心,南通棋牌游戏中心,贵港热线休闲游戏中心,淮安棋牌游戏中心


_________________________________________________________________________________________________________________

"Look at the sky. We are not alone. The whole Universe is friendly to us and conspires only to give the best to those who dream and work."

- Dr. A P J Abdul Kalam
_________________________________________________________________________________________________________________