help me with this

Can someone explain why the last rows (Row 20-22) are necessary? What would happen if we didn’t have it and we called upon the UserDTO class?
No description
4 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @dghf! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
0x150
0x1502y ago
that's a getter, it basically allows read only access to a property, and allows you to do extra checks before handing out the value, for example there's also setters that accept a value, which then set the backing field, after (again, for example) doing some checks on the passed value name is private, which means that only UserDTO itself can access it. the getter basically provides read access, but since there's no setter, it can't be set from outside
JavaBot
JavaBot2y ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one.

Did you find this page helpful?