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 trialJack Brackenbury
54 PointsBuild a weather app task 2
How do i do this
class Forecast {}
private {}
int mHighTemp
int mLowTemp
int mPrecipChance
1 Answer
Richard Ling
8,522 PointsHi Jack,
Nearly there, the content has to be between the class braces { }, and each property has to be declared as private independently. Each declaration line would also need a closing semi-colon. The class itself also needs the public access modifier.
public class Forecast {
private int mHighTemp;
private int mLowTemp;
private double mPrecipChance ;
}
Additionally, the 3rd item (mPrecipChange) should have been a double instead of an int.
Hope this makes sense :)
Richard Ling
8,522 PointsRichard Ling
8,522 PointsI just noticed you are on the Android Build a Weather App course. If you feel that you are struggling with some of the declarations, I would suggest (if you haven't already, or aren't familiar with it) having a look at the Java Basics and Java Objects course.
These 2 courses cover all these items in great detail and help set the foundation for these later courses :)