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!

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

Android Build a Weather App (2015) Exploring an API Android Warm-Up

Build a weather app task 2

How do i do this

class Forecast {}
  private {}
    int mHighTemp
    int mLowTemp
    int mPrecipChance 

1 Answer

Richard Ling
Richard Ling
8,522 Points

Hi 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
Richard Ling
8,522 Points

I 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 :)