when the registration details are public visibility, can i used getter and setter for registration details ? please help
Asked
Active
Viewed 549 times
1 Answers
0
Short answer: Yes. In general visibility has no impact on possibility to have getters and setters (accessors).
Long answer: Visibility has no direct impact on possibility of using accessors. Be however very careful. Using public visibility for attributes is in most cases against paradigms of object oriented approach. Also setting public accessors to all attributes leads to actual situation similar to making all attributes public. Maybe you should reconsider your design in general?

Ister
- 5,958
- 17
- 26