Originally posted by shashankk gupta: Declaration of j was in for block,once the for block is finished the variable j is destroyed ,its a local variable .......hence using j outside this block will give an compiler error
Howdy shashankk gupta,
Welcome to JavaRanch
Thanks for the contribution.
I guess you might have clicked on the 'Post New topic' button instead of 'Post reply' button, thereby you got a chance to edit the title as well.
Please be careful when replying so that you can avoid this mistake in future.