By default, it is passed by value. However, you pass the reference to the object by value, which means that you can still edit the values โโinside the object.
To prevent the possibility of modifying an object in general, you will need to actually clone the object before passing it to your method. This will require you to implement some method of creating a new instance, which is a copy of the original object, and then transferring to the copy.
source share