sukhavasi vasavi wrote:
because run method is in local.It will not affect i value out of the metod
Not correct. Since i is an instance variable and not local for the run() method, a call to run() method will change the value of i for that instance. So the output will be 0 then 1.