Multiple choice technology programming languages

In a method call when an object reference is passed as an argument , So what gets passed actually ?

  1. The object itself

  2. a copy of reference

  3. the original reference

  4. a reference to a copy

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Java, object references are passed by value - meaning a copy of the reference is passed to the method, not the original reference itself or the object. The called method receives its own copy of the reference, which points to the same object. If the method reassigns the reference parameter, it doesn't affect the caller's reference - but modifications to the object's state are visible since both references point to the same object. Option B correctly captures this 'copy of reference' behavior.