Well when your wrong your wrong, (serves me right for trying to answer a question while studying!) The label is used with the break to terminate THAT loop and any inside of it. So as I was so correctly corrected i increments NOT the inner variables.
Put printlns after each for statement and after the counter increment & you will see the results step by step. This is what comes out:
F:\JavaProgs>
java LoopTest
i is: 0
j is: 0
k is: 0
Counter is: 1
k is: 1
i is: 1
j is: 0
k is: 0
Counter is: 2
k is: 1
i is: 2
j is: 0
k is: 0
Counter is: 3
k is: 1
3
So the final answer is 3.
[ January 13, 2002: Message edited by: DC Dalton ]