hello,
I have this question to ask from you...

when passing a object to a method is it pass by reference or pass by value ? I'm talking about calling another class's method...

In java, objects, arrays and strings are always passed by reference. Only primitive types (byte, char, int, long) are passed by value.

In java, objects, arrays and strings are always passed by reference. Only primitive types (byte, char, int, long) are passed by value.

thanks

That's right. Java is only pass by value, regardless of whether parameters are primitive types or reference types.

When the method or constructor is invoked (§15.12), the values of the actual argument expressions initialize newly created parameter variables, each of the declared Type, before execution of the body of the method or constructor.

Java Language Specification section 8.4.1

This question has already been answered. Start a new discussion instead.