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
Angelic Thompson
2,017 PointsI don't understand what i'm doing wrong I typed this in (System.out.printf("the coloris %s,"kart.getColor);
I keep getting syntax error ./Example.java:6:error: cannot find symbol symbol: variable getColor location: variablr kart of type GoKart
1 Answer
Derek Markman
16,291 PointsFrom just solely going off of the title of this thread, the 2 syntax errors i see are:
Your closing parenthesis goes before the comma not after.
When you're invoking the getColor method in your printf statement, you need to add the parenthesis for the method argument. Even if your method doesn't take any arguments you still need to add the parenthesis to the end of it.
This is what your printf statement should look like:
System.out.printf("The color is %s", kart.getColor());
Angelic Thompson
2,017 PointsAngelic Thompson
2,017 Pointsokay so the comma was in the wrong place and need to make sure I add the extra parenthesis! got it(^_^)/ muchos thankies
Derek Markman
16,291 PointsDerek Markman
16,291 PointsNo problem.