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 trialJoseph Waugh
409 PointsDeclaring a file.
How am I able to create a new file known as GoKart.java instead of the example file.
public class GoKart {
public String mKartColor = "Red";
public String getKartColor(){
return mKartColor;
}
}
3 Answers
Ken Alger
Treehouse TeacherJoseph;
I am a little confused by your question as it relates to the linked challenge, which asks:
Please create a new
GoKart
object. As you know it takes a singleparameter
, color.
I don't see where you need to create a new file. Can you expound on what you are trying to do?
Thanks,
Ken
ISAIAH S
1,409 Pointspublic class Example {
public static void main(String[] args) {
GoKart mColor = new GoKart("red");
System.out.println("We are going to create a GoKart");
// For the second task:
System.out.printf("The color is %s", mColor.getColor());
}
}
You don't need to make a new file.
Kim Gun
Front End Web Development Techdegree Student 4,814 Pointsjust create a new file called GoKart.java and paste your code in this new file name !
Joseph Waugh
409 PointsJoseph Waugh
409 PointsI am stuck in the same situation as you. If you find a solution please let me know.