In an inner scope, a variable declaration will shadow any previous declaration. In your code sample the output will be the value of ch
on each loop iteration.
If you were to output the value of i
outside the inner for, the output would be the value of the i
declared in the first for loop.