0
Setting can be modified, so can get element too?
So if the for example setting can be modified can an get accessor of property be also optimized (modified) like if something return something else return somethin else or are there any limits with any of them?
1 Resposta
+ 1
Yes. That is pretty much the whole point of public properties with getters and setters. The only limitation is that you are not exactly sending parameters when you call getters or setters. The concepts have to do with encapsulation. Creating a class with good encapsulation will inform you better on how getters and setters should be used.