Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Build a weather app task 2

How do i do this

Forecast.java
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 :)