Jun-07-2023, 03:26 AM
If the object is immutable, it cannot be "passed by reference". No changes can be made to the object, so any operation, like incrementing, creates a new object. If the object is mutable, it is always "passed by reference". Changes made to the object will be seen by anyone who references the object.
Sounds like you need to create a mutable object that behaves like a number, at least some of the time, but can have it's "value" changed.
Sounds like you need to create a mutable object that behaves like a number, at least some of the time, but can have it's "value" changed.