63.4k views
3 votes
When an object reference is passed as a parameter to a method, modifying the members of that object from inside the method will result in a change to that object as seen from the client.

a. True
b. False

1 Answer

1 vote

Answer:

A) True

Step-by-step explanation:

Objects are known as reference types, meaning that they are always accessed by references, not copied. When a method is called, passing an object to it, Java passes a reference of that object to the method and when that reference is modified, the changes can be seen in the object itself. Therefore a mutable object can be mutated anywhere- either from where it is created or by a method it is passed to. Hence the need to always use privacy modifier keywords such as public, private or protected, to determine the exposure of class properties and methods.

User Khalid Omar
by
6.4k points