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 trialRobert Walsh
802 Pointsconfused on how to create the object...any help would be great?
confused on placement and how to create this
public class Example {
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
}
}
2 Answers
Ken Alger
Treehouse TeacherRobert;
This redirects the conversation from the post here to this forum thread.
Prompting Code:
public class Example {
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
}
}
So, your question in the other post thread was related to where you put the code for this challenge, correct? Specifically the other student had another line of code after public class Example {
that was attempting to make a class inside the Example
class, or a nested class. That is not necessary for this challenge at all.
You want to create the new GoKart
object after the statement that you are going to create a GoKart, so it would look something like:
public class Example {
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
GoKart purpleKart = new GoKart("purple");
}
}
Post back if you are still stuck.
Ken
Robert Walsh
802 PointsThank you, this worked perfectly.
Ken Alger
Treehouse TeacherRobert;
Welcome to Treehouse!
I posted an answer to this question here. Have a look and post back with any additional questions.
Happy coding,
Ken
Robert Walsh
802 Pointsthank you very much for your quick response
Ken Alger
Treehouse TeacherRobert;
Any further questions or was the previous post sufficient in explaining things?
Ken
Robert Walsh
802 Pointsstill confused when i place your code into the challenge it returns an error
Robert Walsh
802 PointsRobert Walsh
802 PointsI need to create the object GoKart