previous |
start |
next
Copying Object References
- BankAccount account1
= new BankAccount(1000);
BankAccount account2
= account1;
account2.deposit(500);
- Change through account2 is also visible through
account1
- Object variables hold references, not objects
previous |
start |
next