When you pass a variable to a method, it is passed by value. A copy of the variable is passed to the method. Watch the example in this video.
When you pass an object to a method, it is passed by reference. The actual object is passed to the method. Watch the example in a future video, so please subscribe!
On this page of the site you can watch the video online Java Methods - Passing Variables by Value vs. Pass by Object Reference - Appficial with a duration of hours minute second in good quality, which was uploaded by the user Appficial 16 October 2017, share the link with friends and acquaintances, this video has already been watched 8,203 times on youtube and it was liked by 66 viewers. Enjoy your viewing!