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 trialErik Russell
1,032 PointsPurpose of currentWeather class.
So I have gone a bit further in the series but have come back to clear up some confusions. The currentWeather class (later renamed to current) is confusing me. I am not fully understanding its function. Could somebody clear this up for me in a bit more detail?
1 Answer
Steve Hunter
57,712 PointsHi Erik,
From memory, the Current
class is used to create a single instance of itself to hold the forecast data for the present time. This is held in the Forecast
class as a member variable of that class.
Similar classes, such as Hour
or Day
are also generated and similarly held in the Forecast
class. Due to their nature, those class instances are stored in arrays of instances.
Which bit of the Current
class is concerning you?
Steve.