sumit kothalikar wrote:see the following program
this program gives me endless loop when i comment line 1.
I know the logic of for loop makes it to be endless loop but the above code compiles and runs successfully even if it has endless loop in code
is it related to static instance variable?
This code will always execute an endless loop whether you comment line 1 or not, try to wrap the for loop code into {}.
HTH
Minhaj