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 trial

Java Java Objects (Retired) Meet Objects Creating Classes

Dov Brodkin
Dov Brodkin
2,695 Points

Class issues in Java

In Java Objects, I had to write a class,

public class GoKarts {

}

Yet it will not except it, does anyone know why?

GoKart.java
public class GoKarts {

}
Dov Brodkin
Dov Brodkin
2,695 Points

Nevermind I reopened the page and did the exact same thing, which work (no clue why, I wrote the same code).

If your file is GoKart.java then your class should be named GoKart- without the 's'.

1 Answer

Jacob Bergdahl
Jacob Bergdahl
29,118 Points

The class should've been called GoKart in singular, not GoKarts in plural :) The way the question was phrased I see it was an easy mistake to make! Make sure to always double-check the question and the file name when something isn't working :)