Copy or referencebeginner
Assigning a struct copies the value, while assigning a class copies only the reference, so two variables can name one object — and passing an argument follows exactly the same rule.
“As a parent, I can top up my child’s school wallet.” Before any wallet logic gets written, you need to know what an assignment copies. Predict the seven numbers this prints, without running it.
All seven predicted values match what the program prints.
Published in full, before you start — every point is one of these and there is nothing else.
Assigning a struct copies the value, while assigning a class copies only the reference, so two variables can name one object — and passing an argument follows exactly the same rule.