Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Unsubscribed User
12,721 PointsThe rationale between getters, setters and constructor with all fields.
I was wondering why getters, setters and constructors are required for all fields in the Gif class. For example, when a new gif is created:
- it won't be favorite'd by default by the user, so the boolean should be set to false in a new gif by default and should not be required as a constructor parameter.
- the users shouldn't ideally have the ability to change the upload date and username for a gif, so the setters for those two fields shouldn't be required.