Getter and setter are widely used in Java programming. However, not every programmer understands and implements these methods properly. So in this Java tutorial, I would like to discuss deeply getter and setter in Java.
Table of content:
1. What are getter and setter?
2. Why getter and setter?
3. The naming convention for getter and setter
4. Common mistakes when implementing getter and setter
5. Implementing getters and setters for primitive types
6. Implementing getters and setters for common object types
7. Implementing getters and setters for collection type
8. Implementing getters and setters for your own type
2. Why getter and setter?
3. The naming convention for getter and setter
4. Common mistakes when implementing getter and setter
5. Implementing getters and setters for primitive types
6. Implementing getters and setters for common object types
7. Implementing getters and setters for collection type
8. Implementing getters and setters for your own type
No comments:
Post a Comment