Suppose you have an updateAccount method with two parameters, an int variable named yearsAccumulatingInterest and a reference

Question:

Suppose you have an updateAccount method with two parameters, an int variable named yearsAccumulatingInterest and a reference variable named bankAccount. The bankAccount variable’s object contains an instance variable named balance. Within the method’s body, the yearsAccumulatingInterest parameter gets updated and the bankAccount object’s balance gets updated. In a method that calls the updateAccount method, after returning from the updateAccount method, the yearsAccumulatingInterest argument’s value is unchanged and the bankAccount argument’s balance value is changed. Explain why there is a difference. 

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: