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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Jonathan Grieve](https://uploads.teamtreehouse.com/production/profile-photos/601842/micro_twitterCover.png)
Jonathan Grieve
Treehouse Moderator 91,253 PointsNo setter method for activity?
I'm curious as to why we don't have a setter method for activity()
?
Is there a reason for this or was there just no reason to demonstrate one in this video?
1 Answer
![Joel Bardsley](https://uploads.teamtreehouse.com/production/profile-photos/125124/micro_GfP2kypW_400x400.jpg)
Joel Bardsley
31,249 PointsFor the activity, there wasn't anything to pass as a required argument for a setter method. It just took the current time (in hours) and computed the value based on that.
You could change it to a setter method if you wanted to manually pass a chosen hour as an argument, I guess, but the activity example was useful as it's the sort of value you wouldn't want to attach to the object.
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsThanks Joel,
I'm just reviewing this course in prep for the upcoming "By Example" course. I keep thinking we should be getting a matching setter for the activity property and it always throws me that we start a new setter for another property. I think that's just my brain doing the talking but I thought I should ask. :)
Joel Bardsley
31,249 PointsJoel Bardsley
31,249 PointsI just happened to go through this course earlier this afternoon. Enjoyed it, looking forward to the 'By Example' one!