DEVFYI - Developer Resource - FYI

Objects are passed by value or by reference?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

498. Objects are passed by value or by reference?

Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object .

(Continued on next question...)

Other Interview Questions