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 trialNeelesh Tewani
1,239 Pointsi don't know how the color will be printed in the second task of this challenge
// i have done this public class Example {
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
GoKart gk = new GoKart("blue");
System.out.printf("the name of the color is %s".getColor());
}
}
4 Answers
Seth Reece
32,867 PointsHi Neelesh,
You are really close. In your printf line, you want ", //the thing you want to pass to %s" instead of a ".". When calling getColor(), you need to call it on something. In this case it would be the gokart you made named gk.
Neelesh Tewani
1,239 Pointsi am still not able to understand can you explain me with code
Neelesh Tewani
1,239 Pointsk it will give me the answer like" the name of the color is blue"
Neelesh Tewani
1,239 PointsThanks Seth
Seth Reece
32,867 PointsSeth Reece
32,867 Points