Multiple choice technology programming languages

Which code from the given options if put in Main class will not print “Done”?

  1. Function call:- changeName(im); Function implementation :- { im.name = "Done"; return null; }

  2. Function call:- changeName(im); Function implementation :- { im = new Item("Done"); return null; }

  3. Function call :- im = changeName(im); function implementation :- { Item otherObject = new Item("Done"); return otherObject; }

  4. All of the above

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

Java is pass-by-value. Reassigning the local parameter im to a new object inside the method does not affect the original reference in the calling function, meaning the original object's name remains unchanged.