A method receives a WellnessProfile object as a parameter and calls setRiskLevel(5) on that parameter. What can happen after the method finishes?
Explanation
Calling a mutator on a parameter reaches the object itself, not a copy of it. This is the central difference between passing an object and passing a primitive, and the rest of this topic follows from it.
- B is not correct: variable names are fixed when they are declared and are never replaced at run time.
- C is not correct: passing an object to a method does not change what kind of value it is.
- D is not correct: a class is defined once, and a call does not copy the definition anywhere.