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 trialUriah Nevins
1,121 Pointscompiler error for my code. please help
In don't understand what is wrong with my code. I'm sure it will seem dumb and obvious, but I need some help.
public class Example {
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
GoKart goKart = new GoKart("red");
System.out.printf("The color is %s\n",gokart.getColor());
}
}
2 Answers
Steve Hunter
57,712 PointsHi Uriah,
You created the object and called it goKart
then missed out the capital K
when you used it.
GoKart goKart = new GoKart("red");
System.out.printf("The color is %s\n", gokart.getColor()); // capital K needed
Steve.
Kristian Gausel
14,661 Pointsyou need to use the variable name with the correct capitilization you use gokart when it should be goKart =)
Uriah Nevins
1,121 PointsUriah Nevins
1,121 PointsLike I said: dumb and obvious. =) Thanks all.
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsWe all do it!!!