Java is always pass-by-value. Unfortunately, when we pass the value of an object, we are passing the reference to it. This is confusing to beginners. The key point is that Java never provides direct access to the values of objects themselves, in any circumstances. The only access to objects is through a reference to that object. Because Java objects are always accessed through a reference, rather than directly, it is common to talk about fields and variables and method arguments as being objects, when pedantically they are only references to objects.
So, when calling a method
For primitive arguments (int, long, etc.), the pass by value is the actual value of the primitive .
For objects, the pass by value is the value of the reference to the object.