posted 17 years ago
HI Trivedi,
This is because you are initializing j after calling the giveMeJ() method. So by the time you call this method j does not have any value except default value 0. If you change private int j = 10 before calling giveMeJ() it prints 10. Please do verify.
- Surya
Sai Surya, SCJP 5.0, SCWCD 5.0, IBM 833 834
http://sai-surya-talk.blogspot.com, I believe in Murphy's law.