❔ Help
is it okay to define the set function of a property as public but add it a statement that checks that the value i got is matching according to my needs?
4 Replies
yes?
Sure, you can add validation logic to the property
your question is a bit vague but part of the benefit of using getters and setter is that you can add logic to them to control what is being set or retrieved
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.