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 trialJimmy Nguyen
1,940 PointsNo idea where to start
Can I get a hint on where I should start? I have no clue...
public class Example {
public static void main(String[] args) {
System.out.println("We are going to create a GoKart");
}
public String Parameter()
}
2 Answers
Grigorij Schleifer
10,365 PointsHi Jimmy,
to create a new instance of the class is the same as creating a new object of that class.
So do it like this:
Here we are creating a new instance of the GoKart class:
GoKart nameOfYourChoise = new Gokart();
// new creates a new instance, we call it instantiation
// inside the parethesis you can put arguments
// that are defined inside your constructor
Does it make sense?
Grigorij
Jimmy Nguyen
1,940 PointsAWHHH!!!! Thank you! So all I was missing was a color?!? so close dang it.
Grigorij Schleifer
10,365 Points:))))
We need mor color in our lives :)))
Se you in the forum !
Jimmy Nguyen
1,940 PointsJimmy Nguyen
1,940 PointsThank you for the help! But I still do not understand.
I'm not sure what an instance is either. So "GoKart" /*without the quotes */ creates the new class? and the parenthesis makes the parameter right? so what is the quiz asking for?
this is what i end up with.... public class Example {
GoKart Vroom = new Gokart (); } }
but i'm still getting an error : ./Example.java:5: error: cannot find symbol GoKart Vroom = new Gokart (); } ^ symbol: class Gokart location: class Example 1 error
Grigorij Schleifer
10,365 PointsGrigorij Schleifer
10,365 PointsHey there :)
Does it make sense?