Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

How to clone object for setter safety?

User_05BQKSep 13 2021 — edited Sep 13 2021

I have written some code:
image.pngimage.pngimage.pngwhen I set id "roleOp" with roleOp.setId(2), Role of User changes id = 2, I no idea. I don't want to change Role User by "roleOp" changed

Comments
Post Details
Added on Sep 13 2021
0 comments
77 views