Welcome to JavaRanch
Thank you for replying, both of you, but your replies were confusing, and I am not convinced you have understood pass-by-value and pass-by-reference.
This question has come up several times; look at
this thread where I replied only a few minutes ago. Note the links to older threads and a JavaRanch FAQ. See whether any of those is helpful. There is one link in the old
thread where it describes what happens in Pascal, which does support pass-by-reference.
The post again and see whether you have understood the problem.