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 trialPranav McCabe
385 PointsNot sure what I am doing wrong in this challenge.
Could someone tell me what I am doing wrong? I can't figure it out.
Thanks
public class Example {
GoKart = new
GoKart("blue");
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
}
}
1 Answer
Preston Skaggs
11,818 PointsYou need to instantiate the object in a method. In this case your main method.
public class Example {
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
GoKart cart = new GoKart("blue");
}
}
EDIT: Also you weren't declaring a variable after the type. "GoKart cart"
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsHi Preston, just fixed the markdown. Thanks for helping to answer questions!
Preston Skaggs
11,818 PointsPreston Skaggs
11,818 PointsThanks Robert. What am I doing wrong with the markdown?
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsIt was missing the language specifier. Unfortunately I don't know a way to just type it to show you, because it gets parsed. Check out the Markdown Cheatsheet and it should be clear what I'm talking about.
Preston Skaggs
11,818 PointsPreston Skaggs
11,818 PointsOk, got it. I just edited the answer and see what you mean.
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherHey guys, you can always check out or book mark this post for code posting instructions. I also have somewhere an animated
gif
that is pretty helpful on this topic. I'll see where I hid it.EDIT
Found it, but it looks like images have been disabled, sorry.
Ken
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsAwesome, very helpful, bookmarked! I chuckled a bit when I saw markdown for c ... that'd be an epic Treehouse series.
mikes02
Courses Plus Student 16,968 Pointsmikes02
Courses Plus Student 16,968 PointsPranav, if the answer sufficiently addressed your challenge we encourage you to select it as the "Best Answer", this rewards the person who posted the answer with some points, and it also lets other forum users know that a selected answered is available if they check out your post. Thank you!
Preston Skaggs
11,818 PointsPreston Skaggs
11,818 PointsThanks Ken, that's much more helpful than the cheat sheet.