what is the difference between pass by reference and call by reference in java ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Java does not pass any variables by reference.
It is tempting to think of objects being passed by reference in Java — but harmful. Variables of object type are references. When passed, they are passed by value.
In other languages, pass-by-reference and call-by-reference are the same thing.
Edit: More detail is provided in the existing stackoverflow question “Is Java pass by reference?” (Spoiler: No.)