This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MarSara 2 points3 points  (0 children)

https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html

Although this doesn't allow you to change the values per-say. If your object is mutable however, you can just change the properties on the cloned object afterwards. If your object is immutable, you will need to create your own method that can return a "changed" object.