❔ Difference between public property with protected setters and getters and protected property?
q
7 Replies
Iirc it's not possible for a property getter to have an accessibility equal to or less than the setter (besides public)
Thinker
REPL Result: Failure
Exception: CompilationErrorException
Compile: 441.349ms | Execution: 0.000ms | React with ❌ to remove this embed.
it can be protected if the setter isnt
In which case you'll have a property which anyone can set but only derived classes can read
if the property itself is protected, does it extend to both get and set?
Yeah, then both the getter and setter with be protected
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.