| Author |
Doubt:control flow working
|
mansi gupte
Ranch Hand
Joined: Dec 30, 2008
Posts: 72
|
|
can some please explain the working of this code?
thanks,
Piya
|
 |
harilal ithikkat
Ranch Hand
Joined: Oct 06, 2008
Posts: 221
|
|
Actually the output what iam geting is
Green
and my explanation is dat
while your i becomes 3 continue from start...but at that time i will remain 3 won't reinitialize and it becomes
4 because of i++
then count becomes 3 and break start means control will leave out of the iterator..i mean control will go to the code just after that for loop..
now it will print the colours[3] and its green
|
SCJP 1.5
"A candle looses nothing by lighting another candle"
itechmentors.com
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32830
|
|
|
I hope you are not trying to tell us that labelled continue is good programming practice.
|
 |
 |
|
|
subject: Doubt:control flow working
|
|
|