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

Java Java Objects (Retired) Meet Objects Creating Classes

what does it mean when it says "oh no, null."

IT won't let me move on

GoKart.java
public class GoKart {
  public String mRed;
}

2 Answers

Ryan Ruscett
Ryan Ruscett
23,309 Points

Hola,

Breakdown! lol

Now let's temporarily add a public field that we will use to store the color of the GoKart. Let's make it the set to the String of "red".

Variable that is public. The variable stores the color of the GoKart. So the name makes sense to call GoKart. It's a string and the value is red.

So I have a public variable named GoKart that is = to red.

public class GoKart {
  public String mGoKart = "red";

}

Null - means that some value is null. Java can't have null values. If you get a Null, it's a null pointer exception. Meaning some variable being referenced does not have a value. It fails because you can't reference a variable without a value. What's the point? Well, for all intensive purposes 8 )

Let me know if that answers your question or if you have other issues I can help resolve.

Thanks!

it did help! thanks!