Originally posted by fred rosenberger:
in your third example, it is possible to get to the "k=10" without hitting the "int k=5", if j happens to equal 2 when the code runs. so, the compliler is complaining that it is POSSIBLE that k is never initialized.
Value of k is used in methodA(k), but the assigment k=10 initializes the variable k, so the compiler must not complain about uinitialized variable.
Only error is missing ; after int j = 10 .
[ August 11, 2006: Message edited by: Vlado Zajac ]