Examine the object diagram shown at right. If this diagram represents the state
ID: 3824212 • Letter: E
Question
Examine the object diagram shown at right. If this diagram represents the state of memory before the following statements are executed, what are the values of x and y after the statements are executed? How is the object diagram changed by these statements?
fred.deposit( 150 );
double x = barney.getBalance();
double y = fred.getBalance();
fred.deposit( 150 );
double x = barney.getBalance();
double y = fred.getBalance();
Explanation / Answer
The values of x and y are :-
x= 1000;
y=775
By these statements , the only change in that object diagram is the value of balance in the fred object.The value is changed to 775 from 625
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.